This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[incremental] Patch: FYI: avoid ICE
- From: Tom Tromey <tromey at redhat dot com>
- To: Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 05 Oct 2007 15:50:52 -0600
- Subject: [incremental] Patch: FYI: avoid ICE
- Reply-to: Tom Tromey <tromey at redhat dot com>
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))