Optimization bug

Phillip Ezolt ezolt@perf.zko.dec.com
Mon Oct 12 11:18:00 GMT 1998


Hi,	
	I was working on porting the upcoming SPEC CPU99 benchmark suite to
Alpha/Linux and I stumbled on the following compiler bug. 

First, it is only appearant when compiling with optimizations.
(Since we are going for high-power numbers we NEED to use optimizations)

-O..-O4 breaks compilation.

This file is part of "perl" (pp.c), so I am kind of surprised that nobody
else has jumped up screaming.  

The Computer is an alpha ev5 running Redhat linux 5.1.  Egcs version is 1.1b. 
 
[ezolt@cpu98 egcs_bug]$ gcc -v --save-temps -O -o pp.o  pp.c
Reading specs from /usr/local/lib/gcc-lib/alphaev5-unknown-linux-gnu/egcs-2.91.5
7/specs
gcc version egcs-2.91.57 19980901 (egcs-1.1 release)
 /usr/local/lib/gcc-lib/alphaev5-unknown-linux-gnu/egcs-2.91.57/cpp -lang-c -v -
undef -D__GNUC__=2 -D__GNUC_MINOR__=91 -Dlinux -Dunix -D_LONGLONG -D__ELF__ -D__
linux__ -D__unix__ -D_LONGLONG -D__ELF__ -D__linux -D__unix -Asystem(linux) -D__
OPTIMIZE__ -D__LANGUAGE_C__ -D__LANGUAGE_C -DLANGUAGE_C -Acpu(alpha) -Amachine(a
lpha) -D__alpha -D__alpha__ -D__alpha_ev5__ -Acpu(ev5) pp.c pp.i
GNU CPP version egcs-2.91.57 19980901 (egcs-1.1 release) (Alpha GNU/Linux for EL
F)
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/local/alphaev5-unknown-linux-gnu/include
 /usr/local/lib/gcc-lib/alphaev5-unknown-linux-gnu/egcs-2.91.57/include
 /usr/include
End of search list.
 /usr/local/lib/gcc-lib/alphaev5-unknown-linux-gnu/egcs-2.91.57/cc1 pp.i -quiet
-dumpbase pp.c -O -version -o pp.s
GNU C version egcs-2.91.57 19980901 (egcs-1.1 release) (alphaev5-unknown-linux-g
nu) compiled by GNU C version egcs-2.90.27 980315 (egcs-1.0.2 release).
pp.c: In function `seed':
pp.c:16: internal error--unrecognizable insn:
(insn 48 20 21 (set (reg:DI 4 $4)
        (mult:DI (reg:DI 30 $30)
            (const_int 4))) -1 (nil)
    (nil))
toplev.c:1360: Internal compiler error in function fatal_insn       

And the corresponding pp.i file:
# 1 "pp.c"

static unsigned long seed(void)
{
    unsigned long u;
    u = getpid();
    u = 26107 * (unsigned long)&u;
    return u;
}

If you need any more info (Or need me to test something out..) feel free to contact me. 

Thanks,
--Phil

Digital/Compaq High Performance Servers/Benchmark Engineering
Phillip.Ezolt@compaq.com




More information about the Gcc-bugs mailing list