This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch for bug 21879


This patch fixes what I believe to be the cause of bug 21879.
Bootstrapped with no regressions on x86_64-unknown-linux-gnu.  Applied
to mainline and 4.0 branch.

Note that as I don't observe the original problem I don't know whether
it does fix the bug, so closing it should wait for submitter
confirmation.  However, it does fix a regression bug in the compiler's
internal logic, whether or not that originally observed.

-- 
Joseph S. Myers               http://www.srcf.ucam.org/~jsm28/gcc/
    jsm@polyomino.org.uk (personal mail)
    joseph@codesourcery.com (CodeSourcery mail)
    jsm28@gcc.gnu.org (Bugzilla assignments and CCs)

2005-06-03  Joseph S. Myers  <joseph@codesourcery.com>

	PR c/21879
	* c-decl.c (start_function): Restore label_context_stack_se and
	label_context_stack_vm  if returning with an error.

diff -rupN GCC.orig/gcc/c-decl.c GCC/gcc/c-decl.c
--- GCC.orig/gcc/c-decl.c	2005-05-30 17:00:36.000000000 +0000
+++ GCC/gcc/c-decl.c	2005-06-03 16:17:53.000000000 +0000
@@ -5802,7 +5802,11 @@ start_function (struct c_declspecs *decl
   /* If the declarator is not suitable for a function definition,
      cause a syntax error.  */
   if (decl1 == 0)
-    return 0;
+    {
+      label_context_stack_se = label_context_stack_se->next;
+      label_context_stack_vm = label_context_stack_vm->next;
+      return 0;
+    }
 
   decl_attributes (&decl1, attributes, 0);
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]