This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch, c] Fix for PR c/39084 - 4.3/4.4 regression
- From: Steve Ellcey <sje at cup dot hp dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 9 Feb 2009 08:54:03 -0800 (PST)
- Subject: [patch, c] Fix for PR c/39084 - 4.3/4.4 regression
- Reply-to: sje at cup dot hp dot com
This ICE is a 4.3/4.3 regression and is caused by start_struct not
returning a NULL pointer when encountering a redefinition error.
We already returning NULL on a nested redefinition error, but not on
a normal redefinition error.
Tested on IA64 HP-UX and Linux with no regressions.
OK to checkin? Perhaps it is simple enought to be considered obvious.
Steve Ellcey
sje@cup.hp.com
2009-02-09 Steve Ellcey <sje@cup.hp.com>
PR c/39084
* c-decl.c (start_struct): Return NULL on error.
Index: gcc/c-decl.c
===================================================================
--- gcc/c-decl.c (revision 143998)
+++ gcc/c-decl.c (working copy)
@@ -5367,6 +5367,8 @@ start_struct (enum tree_code code, tree
error ("redefinition of %<union %E%>", name);
else
error ("redefinition of %<struct %E%>", name);
+ /* Don't create structures using a name already in use. */
+ ref = NULL_TREE;
}
else if (C_TYPE_BEING_DEFINED (ref))
{