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]

[incremental] Patch: FYI: avoid ICE


I'm checking this in on the incremental-compiler branch.

If the FE issues an error and exits early in c_clear_binding_stack,
then it will later ICE in c_write_global_declarations because
ext_block will be NULL.  This patch moves the test.

Tom

ChangeLog:
2007-10-05  Tom Tromey  <tromey@redhat.com>

	* c-decl.c (c_clear_binding_stack): Move early exit...
	(c_write_global_declarations): ... here.

Index: c-decl.c
===================================================================
--- c-decl.c	(revision 129019)
+++ c-decl.c	(working copy)
@@ -8124,11 +8124,6 @@
   if (pch_file)
     return;
 
-  /* Don't waste time on further processing if -fsyntax-only or we've
-     encountered errors.  */
-  if (flag_syntax_only || errorcount || sorrycount || cpp_errors (parse_in))
-    return;
-
   /* Close the external scope.  */
   /* FIXME: we're keeping ext_block around too long in the server.  */
   ext_block = pop_scope ();
@@ -8153,6 +8148,11 @@
 {
   tree t;
 
+  /* Don't waste time on further processing if -fsyntax-only or we've
+     encountered errors.  */
+  if (flag_syntax_only || errorcount || sorrycount || cpp_errors (parse_in))
+    return;
+
   /* Process all file scopes in this compilation, and the external_scope,
      through wrapup_global_declarations and check_global_declarations.  */
   for (t = all_translation_units; t; t = TREE_CHAIN (t))


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