The included file produces a segfault during execution when compiled with -O1 -finline-functions. It does not segfault when compiled with -finline-options and all the options that make up -O1 as per http://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html
The function "foo" will segfault if called with a parameter other than 1. Analysis of the compiler output shows that GCC does not restore the value of the "bar" parameter if consecutive calls to the function "foo" are inlined.
Log in to post a comment.