[Bug middle-end/50266] [4.6/4.7 Regression] internal compiler error: in decode_addr_const, at varasm.c:2638
joseph at codesourcery dot com
gcc-bugzilla@gcc.gnu.org
Fri Sep 2 13:36:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50266
--- Comment #3 from joseph at codesourcery dot com <joseph at codesourcery dot com> 2011-09-02 13:36:20 UTC ---
I don't think there's any particular reason this initializer should need
to be folded in a particular way by the front end; I'd think the front
end's job is to produce a valid GENERIC initializer, whether or not
folded, with folding to something visibly constant only required if the
object initialized is of static storage duration. If you make x static
then it builds OK (although it's not required to) but in C99 an aggregate
initializer of automatic storage duration can have non-constant elements
even if the type of the aggregate is a const-qualified type (that is, x is
initialized once and constant after that). In fact you get the same ICE
when x isn't marked const at all. (And in general the middle-end ought to
be prepared to see aggregate initializers that become constant after
constant propagation but aren't known by the front end to be constant.)
More information about the Gcc-bugs
mailing list