IMPORTANT: m68k pic broken for floating point

Marc Espie
Fri May 28 20:01:00 GMT 1999

Unless I've made something very wrong, m68k -fpic is *completely* broken,
currently. There are some fairly large bugs in floating point support.

This is the smallest testcase I've had yet.  Contrarily to other testcases,
this one *always* fails, even without optimization.

I don't know what's going on, but this is probably awfully easy to solve
for someone who knows rtl.

Disarmingly small (breaks X11, BTW)

cc -fpic oink.c
oink.c: In function `f':
oink.c:4: internal error--unrecognizable insn:
(insn 21 19 7 (set (reg:DF 16 fp0)
        (const_double:DF (mem/u:DF (symbol_ref/u:SI ("*LC0")) 0) 53248 [0xd000] -858993460 [0xcccccccc] -1932771329 [0x8ccc3fff])) -1 (nil)

cc -v
Reading specs from /usr/lib/gcc-lib/m68k-unknown-openbsd2.5/egcs-2.93.22/specs
gcc version egcs-2.93.22 19990517 (gcc2 ss-980929 experimental)

----- oink.c 
double f (double x)
        return 1.1 -x;

This seems to occur ONLY for some constants (replacing 1.1 with 1.0 removes
the bug).  

Replacing 1.1 -x with 1.1+x kills the problem.

More information about the Gcc-bugs mailing list