https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107107
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Known to fail| |4.1.2, 4.4.7, 4.5.3 --- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Here is a testcase which has failed since before 4.1.2: ``` static inline void set_longish(int is_long_long, void *p, long x) { if (is_long_long) *(long long*)p = x; else *(long*)p = x; } static long test(long long *p, int index, int mode) { *p = 1; set_longish(mode, p+index, 2); return *p; } long (*volatile vtest)(long long*, int, int) = test; #include <stdio.h> int main(void) { long long x; long result = vtest(&x, 0, 1); printf("%lu/%llu\n", result, x); } ``` The only difference from the original testcase is marking set_longish as static inline. I suspect what changed between 4.7 and 4.8 for the original testcase is inlining.