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