This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/25632] [4.0/4.1/4.2 Regression] ICE with const int copied into two different functions
- From: "mark at codesourcery dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Jan 2006 00:02:14 -0000
- Subject: [Bug c++/25632] [4.0/4.1/4.2 Regression] ICE with const int copied into two different functions
- References: <bug-25632-10053@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #11 from mark at codesourcery dot com 2006-01-04 00:02 -------
Subject: Re: [4.0/4.1/4.2 Regression] ICE with const int copied
into two different functions
rakdver at atrey dot karlin dot mff dot cuni dot cz wrote:
> what about this patch, then (assuming it passes testing)?
Better -- but there's no reason to do it before the break statement; if
we're not going to use init, then we don't neeed to unshare it. I think
you can do it right *after* the break statement.
> Index: cp/init.c
> ===================================================================
> *** cp/init.c (revision 109271)
> --- cp/init.c (working copy)
> *************** constant_value_1 (tree decl, bool integr
> *** 1503,1508 ****
> --- 1503,1510 ----
> mark_used (decl);
> init = DECL_INITIAL (decl);
> }
> + init = unshare_expr (init);
> +
> if (!(init || init == error_mark_node)
> || !TREE_TYPE (init)
> || (integral_p
>
>
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25632