egcs-19981226: float complex comparisons broken

Horst von Brand vonbrand@sleipnir.valparaiso.cl
Thu Dec 31 18:14:00 GMT 1998


The following tiny program crashes gcc:

__complex__ float
f(__complex__ float x)
{
  __complex__ float res;

  if (__real__ x == 0.0)
    res = x;
  return res;
}

[vonbrand@sleipnir /tmp]# gcc tst.c
tst.c: In function `f':
tst.c:9: fixed or forbidden register 0 (ax) was spilled for class AREG.
tst.c:9: This may be due to a compiler bug or to impossible asm
tst.c:9: statements or clauses.
tst.c:9: This is the instruction:
(insn 13 11 14 (parallel[
            (set (cc0)
                (compare:CCFPEQ (reg:DF 8 %st(0))
                    (reg:DF 9 %st(1))))
            (clobber (scratch:HI))
        ] ) 32 {*cmpsf_cc_1-1} (nil)
    (nil))
../../egcs-19981226/gcc/toplev.c:1397: Internal compiler error in function fatal_insn

egcs-2.92.2[579] and egcs-1.1.1 think this is fine.

egcs was built on linux-2.1.132ac2, binutils-2.9.1.0.19a, glibc-2.0.108
-O2 -fomit-frame-pointer -march=pentium, haifa enabled
i856-redhat-linux-gnu

Now runs on linux-2.2.0-pre1-ac4, built with the same compiler (Nice that the
kernel doesn't do complex math :)

Please note that this testcase is distilled out of one of the files in
glibc-2.0.109, so this is kind of urgent...

Thanks!
-- 
Horst von Brand                             vonbrand@sleipnir.valparaiso.cl
Casilla 9G, Viña del Mar, Chile                               +56 32 672616



More information about the Gcc-bugs mailing list