This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/50199] [4.7 Regression] wrong code with -flto -fno-merge-constants
- From: "hubicka at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 03 Jan 2012 18:06:28 +0000
- Subject: [Bug middle-end/50199] [4.7 Regression] wrong code with -flto -fno-merge-constants
- Auto-submitted: auto-generated
- References: <bug-50199-4@http.gcc.gnu.org/bugzilla/>
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