Code generation bug on ultrasprac

Martin Weiser weiser@zib.de
Thu Sep 23 02:20:00 GMT 1999


Dear GCC maintainers,

gcc 2.95.1 seems to generate bad code for the appended minimal
program. Although intended to do absolutely nothing, the executable
bus errors on an Sun Ultra 1/170E and a Sun Ultra 5/10 when compiled
with -mcpu=ultrasparc. Using e.g. -mcpu=hypersparc works well.

Minimal changes to the program (e.g. changing the int parameter of f
to double) result in a working program.

See the terminal session below.

num5$ gcc -v try.cc
Reading specs from /instal/bzfweise/gcc-2.95/installed/lib/gcc-lib/sparc-sun-solaris2.6/2.95.1/specs
gcc version 2.95.1 19990816 (release)
 /instal/bzfweise/gcc-2.95/installed/lib/gcc-lib/sparc-sun-solaris2.6/2.95.1/cpp -lang-c++ -v -D__GNUC__=2 -D__GNUG__=2 -D__GNUC_MINOR__=95 -D__cplusplus -Dsparc -Dsun -Dunix -D__svr4__ -D__SVR4 -D__sparc__ -D__sun__ -D__unix__ -D__svr4__ -D__SVR4 -D__sparc -D__sun -D__unix -Asystem(unix) -Asystem(svr4) -D__EXCEPTIONS -D__GCC_NEW_VARARGS__ -Acpu(sparc) -Amachine(sparc) try.cc /var/tmp/ccSeRrQz.ii
GNU CPP version 2.95.1 19990816 (release) (sparc)
#include "..." search starts here:
#include <...> search starts here:
 /instal/bzfweise/gcc-2.95/installed/lib/gcc-lib/sparc-sun-solaris2.6/2.95.1/../../../../include/g++-3
 /instal/bzfweise/gcc-2.95/installed/lib/gcc-lib/sparc-sun-solaris2.6/2.95.1/../../../../sparc-sun-solaris2.6/include
 /instal/bzfweise/gcc-2.95/installed/lib/gcc-lib/sparc-sun-solaris2.6/2.95.1/include
 /usr/include
End of search list.
The following default directories have been omitted from the search path:
 /usr/local/include
End of omitted list.
 /instal/bzfweise/gcc-2.95/installed/lib/gcc-lib/sparc-sun-solaris2.6/2.95.1/cc1plus /var/tmp/ccSeRrQz.ii -quiet -dumpbase try.cc -version -o /var/tmp/cciyAA89.s
GNU C++ version 2.95.1 19990816 (release) (sparc-sun-solaris2.6) compiled by GNU C version 2.95.1 19990816 (release).
 /usr/ccs/bin/as -V -Qy -s -xarch=v8plusa -o /var/tmp/ccGioa7V.o /var/tmp/cciyAA89.s
/usr/ccs/bin/as: WorkShop Compilers 4.X dev 18 Sep 1996
 /instal/bzfweise/gcc-2.95/installed/lib/gcc-lib/sparc-sun-solaris2.6/2.95.1/collect2 -V -Y P,/usr/ccs/lib:/usr/lib -Qy /instal/bzfweise/gcc-2.95/installed/lib/gcc-lib/sparc-sun-solaris2.6/2.95.1/crt1.o /instal/bzfweise/gcc-2.95/installed/lib/gcc-lib/sparc-sun-solaris2.6/2.95.1/crti.o /usr/ccs/lib/values-Xa.o /instal/bzfweise/gcc-2.95/installed/lib/gcc-lib/sparc-sun-solaris2.6/2.95.1/crtbegin.o -L/instal/bzfweise/gcc-2.95/installed/lib/gcc-lib/sparc-sun-solaris2.6/2.95.1 -L/usr/ccs/bin -L/usr/ccs/lib -L/instal/bzfweise/gcc-2.95/installed/lib /var/tmp/ccGioa7V.o -lgcc -lc -lgcc /instal/bzfweise/gcc-2.95/installed/lib/gcc-lib/sparc-sun-solaris2.6/2.95.1/crtend.o /instal/bzfweise/gcc-2.95/installed/lib/gcc-lib/sparc-sun-solaris2.6/2.95.1/crtn.o
ld: Software Generation Utilities - Solaris/ELF (3.0)
num5$ a.out
Bus Error 
num5$ gcc -mcpu=hypersparc try.cc ; a.out
num5$

Thanks for reading,
Martin


-- 
Martin Weiser     Konrad-Zuse-Zentrum fuer Informationstechnik Berlin
weiser@zib.de     Scientific Computing
                  Numerische Analysis und Modellierung
http://www.zib.de/weiser


More information about the Gcc-bugs mailing list