rpms/gcc/devel gcc41-pr25993.patch, NONE, 1.1 gcc41-pr28217.patch, NONE, 1.1 gcc41-pr30189.patch, NONE, 1.1 gcc41-rh220627.patch, NONE, 1.1 gcc41-pr29054.patch, 1.1, 1.2 gcc41.spec, 1.133, 1.134

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Wed Jan 3 19:15:19 UTC 2007


Author: jakub

Update of /cvs/dist/rpms/gcc/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv18429

Modified Files:
	gcc41-pr29054.patch gcc41.spec 
Added Files:
	gcc41-pr25993.patch gcc41-pr28217.patch gcc41-pr30189.patch 
	gcc41-rh220627.patch 
Log Message:
4.1.1-50

gcc41-pr25993.patch:
 0 files changed

--- NEW FILE gcc41-pr25993.patch ---
2006-09-17  Steven Bosscher  <steven at gcc.gnu.org>

	PR c/25993
	* c-opts.c (c_common_handle_option): Ignore the -std options
	if the input language is assembly.

2006-09-16  Steven Bosscher  <steven at gcc.gnu.org>

	PR c/25993
	* gcc.dg/pr25993.c: New test.

--- gcc/c-opts.c	(revision 117004)
+++ gcc/c-opts.c	(revision 117005)
@@ -268,6 +268,10 @@ c_common_handle_option (size_t scode, co
   enum opt_code code = (enum opt_code) scode;
   int result = 1;
 
+  /* Prevent resetting the language standard to a C dialect when the driver
+     has already determined that we're looking at assembler input.  */
+  bool preprocessing_asm_p = (cpp_get_options (parse_in)->lang == CLK_ASM);
+ 
   switch (code)
     {
     default:
@@ -905,29 +909,34 @@ c_common_handle_option (size_t scode, co
 
     case OPT_std_c__98:
     case OPT_std_gnu__98:
-      set_std_cxx98 (code == OPT_std_c__98 /* ISO */);
+      if (!preprocessing_asm_p)
+	set_std_cxx98 (code == OPT_std_c__98 /* ISO */);
       break;
 
     case OPT_std_c89:
     case OPT_std_iso9899_1990:
     case OPT_std_iso9899_199409:
-      set_std_c89 (code == OPT_std_iso9899_199409 /* c94 */, true /* ISO */);
+      if (!preprocessing_asm_p)
+	set_std_c89 (code == OPT_std_iso9899_199409 /* c94 */, true /* ISO */);
       break;
 
     case OPT_std_gnu89:
-      set_std_c89 (false /* c94 */, false /* ISO */);
+      if (!preprocessing_asm_p)
+	set_std_c89 (false /* c94 */, false /* ISO */);
       break;
 
     case OPT_std_c99:
     case OPT_std_c9x:
     case OPT_std_iso9899_1999:
     case OPT_std_iso9899_199x:
-      set_std_c99 (true /* ISO */);
+      if (!preprocessing_asm_p)
+	set_std_c99 (true /* ISO */);
       break;
 
     case OPT_std_gnu99:
     case OPT_std_gnu9x:
-      set_std_c99 (false /* ISO */);
+      if (!preprocessing_asm_p)
+	set_std_c99 (false /* ISO */);
       break;
 
     case OPT_trigraphs:
--- gcc/testsuite/gcc.dg/pr25993.c	(revision 0)
+++ gcc/testsuite/gcc.dg/pr25993.c	(revision 117005)
@@ -0,0 +1,14 @@
+/* { dg-do assemble { target i?86-*-* x86_64-*-* } } */
+/* { dg-options "-std=c99 -x assembler-with-cpp" } */
+
+#ifndef __ASSEMBLER__
+extern int func(void);
+#else
+.global func
+.type func,%function
+.align 4
+func:
+        ret
+.size func,.-func
+#endif
+

gcc41-pr28217.patch:
 template-1.C  |    8 ++++++++
 template-1.Hs |    5 +++++
 2 files changed, 13 insertions(+)

--- NEW FILE gcc41-pr28217.patch ---
2007-01-03  Jakub Jelinek  <jakub at redhat.com>

	PR c++/28217
	* g++.dg/pch/template-1.C: New test.
	* g++.dg/pch/template-1.Hs: New file.

2006-07-12  Jason Merrill  <jason at redhat.com>

	PR c++/28217
	* semantics.c (note_decl_for_pch): Don't premangle templates.

--- gcc/cp/semantics.c	(revision 115398)
+++ gcc/cp/semantics.c	(revision 115399)
@@ -2339,8 +2339,9 @@ note_decl_for_pch (tree decl)
 
   /* There's a good chance that we'll have to mangle names at some
      point, even if only for emission in debugging information.  */
-  if (TREE_CODE (decl) == VAR_DECL
-      || TREE_CODE (decl) == FUNCTION_DECL)
+  if ((TREE_CODE (decl) == VAR_DECL
+       || TREE_CODE (decl) == FUNCTION_DECL)
+      && !processing_template_decl)
     mangle_decl (decl);
 }
 
--- gcc/testsuite/g++.dg/pch/template-1.C.jj	2007-01-03 17:49:40.000000000 +0100
+++ gcc/testsuite/g++.dg/pch/template-1.C	2007-01-03 17:51:35.000000000 +0100
@@ -0,0 +1,8 @@
+// PR c++/28217
+
+#include "template-1.H"
+
+int
+main (void)
+{
+}
--- gcc/testsuite/g++.dg/pch/template-1.Hs.jj	2007-01-03 17:49:06.000000000 +0100
+++ gcc/testsuite/g++.dg/pch/template-1.Hs	2007-01-03 17:44:39.000000000 +0100
@@ -0,0 +1,5 @@
+template<int> struct A
+{
+  enum { a, b = a };
+  void foo(A<b>);
+};

gcc41-pr30189.patch:
 dwarf2out.c                |    5 ++++-
 testsuite/gcc.dg/pr30189.c |   18 ++++++++++++++++++
 2 files changed, 22 insertions(+), 1 deletion(-)

--- NEW FILE gcc41-pr30189.patch ---
2007-01-03  Alexandre Oliva  <aoliva at redhat.com>

	PR debug/30189
	* dwarf2out.c (modified_type_die): Follow DECL_ORIGINAL_TYPE
	even if cv-qualification is the same.

	* gcc.dg/pr30189.c: New test.

--- gcc/dwarf2out.c.orig	2007-01-02 17:48:15.000000000 -0200
+++ gcc/dwarf2out.c	2007-01-02 17:51:53.000000000 -0200
@@ -8407,7 +8407,10 @@ modified_type_die (tree type, int is_con
 	      mod_type_die = lookup_type_die (qualified_type);
 	    }
 	  else if (is_const_type < TYPE_READONLY (dtype)
-		   || is_volatile_type < TYPE_VOLATILE (dtype))
+		   || is_volatile_type < TYPE_VOLATILE (dtype)
+		   || (is_const_type <= TYPE_READONLY (dtype)
+		       && is_volatile_type <= TYPE_VOLATILE (dtype)
+		       && DECL_ORIGINAL_TYPE (type_name) != type))
 	    /* cv-unqualified version of named type.  Just use the unnamed
 	       type to which it refers.  */
 	    mod_type_die
--- gcc/testsuite/gcc.dg/pr30189.c	1970-01-01 00:00:00.000000000 +0000
+++ gcc/testsuite/gcc.dg/pr30189.c	2007-01-03 14:14:16.000000000 -0200
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-g -O" } */
+
+extern void foo (void);
+
+static
+void baz (int i)
+{
+  foo ();
+  typedef char A[i];
+  struct { A b; } *x = 0;
+}
+
+void
+bar (i)
+{
+  baz (i);
+}

gcc41-rh220627.patch:
 config/rs6000/linux-unwind.h |    4 +--
 unwind-dw2.c                 |   50 +++++++++++++++++++++++++++++++++++--------
 2 files changed, 43 insertions(+), 11 deletions(-)

--- NEW FILE gcc41-rh220627.patch ---
2007-01-03  Jakub Jelinek  <jakub at redhat.com>

	* unwind-dw2.c (SIGNAL_FRAME_BIT, EXTENDED_CONTEXT_BIT): Define.
	(struct _Unwind_Context): Rename args_size to flags, remove
	signal_frame field, add a new args_size field and version field.
	(_Unwind_IsSignalFrame, _Unwind_SetSignalFrame,
	_Unwind_IsExtendedContext): New inline functions.
	(_Unwind_GetGR, _Unwind_SetGR, _Unwind_GetGRPtr, _Unwind_SetGRPtr):
	Assume by_value array is only present if _Unwind_IsExtendedContext.
	(_Unwind_GetIPInfo, execute_cfa_program, uw_frame_state_for): Use
	_Unwind_IsSignalFrame.
	(__frame_state_for): Initialize context.flags to EXTENDED_CONTEXT_BIT.
	(uw_update_context_1): Use _Unwind_SetSignalFrame.
	(uw_init_context_1): Initialize context->flags to
	EXTENDED_CONTEXT_BIT.
	* config/rs6000/linux-unwind.h (frob_update_context): Use
	_Unwind_SetSignalFrame.

--- gcc/unwind-dw2.c.jj	2006-12-08 15:57:44.000000000 +0100
+++ gcc/unwind-dw2.c	2006-12-27 17:16:12.000000000 +0100
@@ -70,8 +70,15 @@ struct _Unwind_Context
   void *ra;
   void *lsda;
   struct dwarf_eh_bases bases;
+  /* Signal frame context.  */
+#define SIGNAL_FRAME_BIT ((~(_Unwind_Word) 0 >> 1) + 1)
+  /* Context which has version/args_size/by_value fields.  */
+#define EXTENDED_CONTEXT_BIT ((~(_Unwind_Word) 0 >> 2) + 1)
+  _Unwind_Word flags;
+  /* 0 for now, can be increased when further fields are added to
+     struct _Unwind_Context.  */
+  _Unwind_Word version;
   _Unwind_Word args_size;
-  char signal_frame;
   char by_value[DWARF_FRAME_REGISTERS+1];
 };
 
@@ -123,6 +130,27 @@ read_8u (const void *p) { const union un
 static inline unsigned long
 read_8s (const void *p) { const union unaligned *up = p; return up->s8; }
 
+static inline _Unwind_Word
+_Unwind_IsSignalFrame (struct _Unwind_Context *context)
+{
+  return (context->flags & SIGNAL_FRAME_BIT) ? 1 : 0;
+}
+
+static inline void
+_Unwind_SetSignalFrame (struct _Unwind_Context *context, int val)
+{
+  if (val)
+    context->flags |= SIGNAL_FRAME_BIT;
+  else
+    context->flags &= ~SIGNAL_FRAME_BIT;
+}
+
+static inline _Unwind_Word
+_Unwind_IsExtendedContext (struct _Unwind_Context *context)
+{
+  return context->flags & EXTENDED_CONTEXT_BIT;
+}
+
 /* Get the value of register INDEX as saved in CONTEXT.  */
 
 inline _Unwind_Word
@@ -141,7 +169,7 @@ _Unwind_GetGR (struct _Unwind_Context *c
   size = dwarf_reg_size_table[index];
   ptr = context->reg[index];
 
-  if (context->by_value[index])
+  if (_Unwind_IsExtendedContext (context) && context->by_value[index])
     return (_Unwind_Word) (_Unwind_Internal_Ptr) ptr;
 
   /* This will segfault if the register hasn't been saved.  */
@@ -180,7 +208,7 @@ _Unwind_SetGR (struct _Unwind_Context *c
   gcc_assert (index < (int) sizeof(dwarf_reg_size_table));
   size = dwarf_reg_size_table[index];
 
-  if (context->by_value[index])
+  if (_Unwind_IsExtendedContext (context) && context->by_value[index])
     {
       context->reg[index] = (void *) (_Unwind_Internal_Ptr) val;
       return;
@@ -203,7 +231,7 @@ static inline void *
 _Unwind_GetGRPtr (struct _Unwind_Context *context, int index)
 {
   index = DWARF_REG_TO_UNWIND_COLUMN (index);
-  if (context->by_value[index])
+  if (_Unwind_IsExtendedContext (context) && context->by_value[index])
     return &context->reg[index];
   return context->reg[index];
 }
@@ -214,7 +242,8 @@ static inline void
 _Unwind_SetGRPtr (struct _Unwind_Context *context, int index, void *p)
 {
   index = DWARF_REG_TO_UNWIND_COLUMN (index);
-  context->by_value[index] = 0;
+  if (_Unwind_IsExtendedContext (context))
+    context->by_value[index] = 0;
   context->reg[index] = p;
 }
 
@@ -256,7 +285,7 @@ _Unwind_GetIP (struct _Unwind_Context *c
 inline _Unwind_Ptr
 _Unwind_GetIPInfo (struct _Unwind_Context *context, int *ip_before_insn)
 {
-  *ip_before_insn = context->signal_frame != 0;
+  *ip_before_insn = _Unwind_IsSignalFrame (context);
   return (_Unwind_Ptr) context->ra;
 }
 
@@ -824,7 +853,8 @@ execute_cfa_program (const unsigned char
      reflected at the point immediately before the call insn.
      In signal frames, return address is after last completed instruction,
      so we add 1 to return address to make the comparison <=.  */
-  while (insn_ptr < insn_end && fs->pc < context->ra + context->signal_frame)
+  while (insn_ptr < insn_end
+	 && fs->pc < context->ra + _Unwind_IsSignalFrame (context))
     {
       unsigned char insn = *insn_ptr++;
       _Unwind_Word reg, utmp;
@@ -1063,7 +1093,7 @@ uw_frame_state_for (struct _Unwind_Conte
   if (context->ra == 0)
     return _URC_END_OF_STACK;
 
-  fde = _Unwind_Find_FDE (context->ra + context->signal_frame - 1,
+  fde = _Unwind_Find_FDE (context->ra + _Unwind_IsSignalFrame (context) - 1,
 			  &context->bases);
   if (fde == NULL)
     {
@@ -1142,6 +1172,7 @@ __frame_state_for (void *pc_target, stru
   int reg;
 
   memset (&context, 0, sizeof (struct _Unwind_Context));
+  context.flags = EXTENDED_CONTEXT_BIT;
   context.ra = pc_target + 1;
 
   if (uw_frame_state_for (&context, &fs) != _URC_NO_REASON)
@@ -1306,7 +1337,7 @@ uw_update_context_1 (struct _Unwind_Cont
 	break;
       }
 
-  context->signal_frame = fs->signal_frame;
+  _Unwind_SetSignalFrame (context, fs->signal_frame);
 
 #ifdef MD_FROB_UPDATE_CONTEXT
   MD_FROB_UPDATE_CONTEXT (context, fs);
@@ -1366,6 +1397,7 @@ uw_init_context_1 (struct _Unwind_Contex
 
   memset (context, 0, sizeof (struct _Unwind_Context));
   context->ra = ra;
+  context->flags = EXTENDED_CONTEXT_BIT;
 
   code = uw_frame_state_for (context, &fs);
   gcc_assert (code == _URC_NO_REASON);
--- gcc/config/rs6000/linux-unwind.h.jj	2006-10-29 21:49:21.000000000 +0100
+++ gcc/config/rs6000/linux-unwind.h	2006-12-28 10:40:19.000000000 +0100
@@ -319,7 +319,7 @@ frob_update_context (struct _Unwind_Cont
   if (pc[0] == 0x38210000 + SIGNAL_FRAMESIZE
       && (pc[1] == 0x38000077 || pc[1] == 0x380000AC)
       && pc[2] == 0x44000002)
-    context->signal_frame = 1;
+    _Unwind_SetSignalFrame (context, 1);
 #else
   /* li r0, 0x7777; sc  (sigreturn old)  */
   /* li r0, 0x0077; sc  (sigreturn new)  */
@@ -328,7 +328,7 @@ frob_update_context (struct _Unwind_Cont
   if ((pc[0] == 0x38007777 || pc[0] == 0x38000077
        || pc[0] == 0x38006666 || pc[0] == 0x380000AC)
       && pc[1] == 0x44000002)
-    context->signal_frame = 1;
+    _Unwind_SetSignalFrame (context, 1);
 #endif
 
 #ifdef __powerpc64__

gcc41-pr29054.patch:
 cp/decl.c                            |    6 +++++-
 testsuite/g++.dg/template/friend49.C |   18 ++++++++++++++++++
 2 files changed, 23 insertions(+), 1 deletion(-)

Index: gcc41-pr29054.patch
===================================================================
RCS file: /cvs/dist/rpms/gcc/devel/gcc41-pr29054.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- gcc41-pr29054.patch	2 Jan 2007 18:56:06 -0000	1.1
+++ gcc41-pr29054.patch	3 Jan 2007 19:15:15 -0000	1.2
@@ -4,6 +4,8 @@
 	* decl.c (revert_static_member_fn): Don't remove first
 	argument without checking it is "this".
 
+	* g++.dg/template/friend49.C: New test.
+
 --- gcc/cp/decl.c.jj	2006-12-15 14:32:06.000000000 +0100
 +++ gcc/cp/decl.c	2007-01-02 17:43:56.000000000 +0100
 @@ -11554,7 +11554,11 @@ revert_static_member_fn (tree decl)


Index: gcc41.spec
===================================================================
RCS file: /cvs/dist/rpms/gcc/devel/gcc41.spec,v
retrieving revision 1.133
retrieving revision 1.134
diff -u -r1.133 -r1.134
--- gcc41.spec	2 Jan 2007 18:56:41 -0000	1.133
+++ gcc41.spec	3 Jan 2007 19:15:15 -0000	1.134
@@ -1,6 +1,6 @@
 %define DATE 20070102
 %define gcc_version 4.1.1
-%define gcc_release 49
+%define gcc_release 50
 %define _unpackaged_files_terminate_build 0
 %define multilib_64_archs sparc64 ppc64 s390x x86_64
 %define include_gappletviewer 1
@@ -149,6 +149,10 @@
 Patch40: gcc41-pr29535-test.patch
 Patch41: gcc41-pr30045.patch
 Patch42: gcc41-pr30286.patch
+Patch43: gcc41-pr25993.patch
+Patch44: gcc41-pr28217.patch
+Patch45: gcc41-pr30189.patch
+Patch46: gcc41-rh220627.patch
 %define _gnu %{nil}
 %ifarch sparc
 %define gcc_target_platform sparc64-%{_vendor}-%{_target_os}
@@ -466,6 +470,10 @@
 %patch40 -p0 -b .pr29535-test~
 %patch41 -p0 -b .pr30045~
 %patch42 -p0 -b .pr30286~
+%patch43 -p0 -b .pr25993~
+%patch44 -p0 -b .pr28217~
+%patch45 -p0 -b .pr30189~
+%patch46 -p0 -b .rh220627~
 
 sed -i -e 's/4\.1\.2/4.1.1/' gcc/BASE-VER gcc/version.c
 sed -i -e 's/" (Red Hat[^)]*)"/" (Red Hat %{version}-%{gcc_release})"/' gcc/version.c
@@ -1537,6 +1545,14 @@
 %doc rpm.doc/changelogs/libmudflap/ChangeLog*
 
 %changelog
+* Wed Jan  3 2007 Jakub Jelinek <jakub at redhat.com> 4.1.1-50
+- backwards compatibility with old layout of struct _Unwind_Context
+  (#220627)
+- fix preprocessor defines in assembly preprocessed with -std=...
+  (Steven Bosscher, PR c/25993)
+- fix PCH creation with templates (Jason Merrill, PR c++/28217)
+- fix dwarf2out ICE (Alexandre Oliva, #217529, PR debug/30189)
+
 * Tue Jan  2 2007 Jakub Jelinek <jakub at redhat.com> 4.1.1-49
 - update from gcc-4_1-branch (-r120062:120325)
   - PRs debug/26964, fortran/30200, libfortran/30145




More information about the fedora-cvs-commits mailing list