[Bug lto/59183] configure of pdsh successfully checks for function shl_load when lto is enabled
rguenth at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Nov 19 09:15:00 GMT 2013
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59183
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |INVALID
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Well, configure tests are usually not prepared for compilers applying a lot of
optimization - especially not assuming that it sees the whole program.
Thus, run configure tests with -O0, not with optimization.
This is hardly a GCC bug, it just optimized away the test which boils down to
char (*f) () = shl_load;
int
main ()
{
return f != shl_load;
}
where obviously the test is always false. LTO then can eliminate the global
variable 'f' because with -flto it knows it cannot be refered to from
elsewhere and whoops - the reference to shl_load is gone.
More information about the Gcc-bugs
mailing list