[Bug middle-end/50199] [4.7 Regression] wrong code with -flto -fno-merge-constants

hubicka at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Jan 3 18:07:00 GMT 2012


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50199

--- Comment #6 from Jan Hubicka <hubicka at gcc dot gnu.org> 2012-01-03 18:06:28 UTC ---
Hmm, adding CONST_DECLs into varpool would be fun: we would have to ensure that
most of target machinery is ready to output CONST_DECLs promoted to hidden vars
by ltrans partitioning + there will be some additional surprises for sure (i.e.
CONST_DECLs being constructed very late in optimization).

The problem is not specific to ipa-cp, ale ipa-split and inlining can migrate
same CONST_DECL across function bodies that can end up in different ltrans
partitions.

I wonder if we should not simply promote CONST_DECLs into initialized const
vars for this purpose by local tree pass running just before early inliner?  I
don't see much of downsides of this transform at them moment, except for lack
of sharing of const pool in between early and late const decls.

Honza



More information about the Gcc-bugs mailing list