The following testcase distilled from ggc-common.c in GCC 3.3.4 is miscompiled on ppc64. It loads a floating point value (70.0) into the pic register and dereferences it, thus the testcase segfaults. /* { dg-do run } */ /* { dg-options "-O2" } */ /* { dg-options "-mminimal-toc" { target powerpc64-*-* } } */ extern void abort (void); extern void exit (int); double __attribute__((noinline)) foo (void) { return 16441577472.0; } double __attribute__((noinline)) bar (double x) { return x; } int __attribute__((noinline)) test (void) { double x = foo (); x = bar (x); x /= 1024 * 1024 * 1024; x *= 70; x = x < 70 ? x : 70; x += 30; return x; } int main (void) { if (test () != 100) abort (); exit (0); }
Oops, sorry. *** This bug has been marked as a duplicate of 16195 ***