bug-autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AC_CHECK_FUNC not safe WRT link time optimizing compilers


From: Jan Hubicka
Subject: AC_CHECK_FUNC not safe WRT link time optimizing compilers
Date: Mon, 25 Oct 2010 20:39:07 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

Hi,
AC_CHECK_FUNC produce test like the following:
char pstat_getstatic ();
char (*f) () = pstat_getstatic;
int
main ()
{
  return f != pstat_getstatic;
}


New GCC with link time optimization is smart enough to ask the linker plugin 
and work out that
variable F is used only by the LTO code.  This makes GCC to promote F as read 
only variable
since it is never written and the test to be optimized away.

Would be possible to fix this, for example, by converting it to:
int pstat_getstatic ();
int
main ()
{
  return pstat_getstatic ();
}

or by marking F volatile?
See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46055
this prevents me from making GCC to use linker plugin information correctly.

Honza



reply via email to

[Prev in Thread] Current Thread [Next in Thread]