This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch, c] Fix for PR c/39084 - 4.3/4.4 regression
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: sje at cup dot hp dot com
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 9 Feb 2009 08:57:29 -0800
- Subject: Re: [patch, c] Fix for PR c/39084 - 4.3/4.4 regression
- References: <200902091654.n19Gs3G06413@lucas.cup.hp.com>
On Mon, Feb 9, 2009 at 8:54 AM, Steve Ellcey <sje@cup.hp.com> wrote:
>
> 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.
Can you add a testcase?
Thanks.
H.J.
> 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))
> {
>
--
H.J.