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:01:28 -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 #10 from mark at codesourcery dot com 2006-01-04 00:01 -------
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:
> tree const_expr = expr;
> do
> {
> expr = fold_non_dependent_expr (const_expr);
> const_expr = integral_constant_value (expr);
> }
> while (expr != const_expr);
>
> and if constant_value_1 (called by integral_constant_value) unshares the
> expression unconditionally (not only when it processes DECL_INITIAL),
> this loop never ends.
OK; then call unshare_expr after the "break" statement in
constant_value_1, and before "decl = init;".
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25632