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]

Re: [patch, c] Fix for PR c/39084 - 4.3/4.4 regression


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.


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