This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug lto/51663] LTO does not reclaim comdat-local statics
- 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: Sat, 24 Mar 2012 21:07:34 +0000
- Subject: [Bug lto/51663] LTO does not reclaim comdat-local statics
- Auto-submitted: auto-generated
- References: <bug-51663-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51663
--- Comment #5 from Jan Hubicka <hubicka at gcc dot gnu.org> 2012-03-24 21:07:34 UTC ---
The resolution info seems to be right, unlike the aforementioned comment.
d: availability:overwritable (asm: _ZZN1C1mEvE1d) needed analyzed finalized
externally_visible prevailing_def_ironly
The reason why it stays in the code is again the logic of promoting it to
static var and consequentely not removing the variable at -O0. I wonder what
policy we want here.
I think some folks still rely on static vars not being removed at -O0. We
probably could remove local statics of functions that has been removed, but
that is an odd rule.
Perhaps we may want to set flag forcing static vars in the code at -O0 instead
of testing the flag late. (effectively making -O0 to drop implicit used flag
on everything). This way the behaviour will be consistet over -fwhole-program
and not.