This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/61144] Invalid optimizations for extern vars with local weak definitions
- From: "bugdal at aerifal dot cx" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 11 May 2014 03:32:11 +0000
- Subject: [Bug c/61144] Invalid optimizations for extern vars with local weak definitions
- Auto-submitted: auto-generated
- References: <bug-61144-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61144
--- Comment #2 from Rich Felker <bugdal at aerifal dot cx> ---
dummy is relevant because there is no reference to dummy except the weak alias.
foo is extern and the reference is to foo. It has a weak definition local to
the translation unit (provided by the weak alias) but this can be overridden.
GCC has handled this correctly ever since 2.x; 4.8.2 is the first version to
mess it up.