This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
g++ 2.95.2 on Alpha miscompiles Qt with -O2 (CSE)
- To: <gcc-bugs at gcc dot gnu dot org>
- Subject: g++ 2.95.2 on Alpha miscompiles Qt with -O2 (CSE)
- From: Tom Holroyd <tomh at po dot crl dot go dot jp>
- Date: Wed, 8 Nov 2000 11:14:14 +0900 (JST)
The attached .ii file is a stripped down "moc" file from a build of Qt
2.2.1. When I compile Qt with -O2 I get segfaults from several test
programs. When I compile with -O1 it's OK. I selected one of the test
programs at random and binary searched the source files for the one that
caused the problem and got lucky. When the entire library is compiled -O2
except for this one file, the test program (dirview) works; adding -O2 to
this one file causes it to segfault. Furthermore, I have determined that
-O2 -fno-cse-follow-jumps -fno-cse-skip-blocks
works correctly -- but if either -fno-cse-follow-jumps or
-fno-cse-skip-blocks is missing, I get a segfault from the test program.
Unfortunately the segfault happens long after this code is executed, so I
can't say exactly what's going on here. However, the moc_qlistview2.ii
file contains only a single method. The method is fairly straightforward
but rather large; it just allocates and fills in some tables -- and it
contains a single "if" at the beginning. The rest is straight line. The
CSE optimizations significantly reorder the .s file, though.
Cheers!
g++ invocation details follow.
g++ -v --save-temps -c -I/usr/X11R6/include -I/usr/local/src/qttest/include -I/usr/X11R6/include -O2 -fPIC -DQT_BUILTIN_GIF_READER=0 -DQT_NO_IMAGEIO_JPEG -DQT_NO_IMAGEIO_MNG -I/usr/local/src/qttest/src/3rdparty/zlib -I/usr/local/src/qttest/src/3rdparty/libpng -o moc_qlistview2.o moc_qlistview2.cpp
Reading specs from /usr/local/lib/gcc-lib/alphaev6-unknown-linux-gnu/2.95.2/specs
gcc version 2.95.2 19991024 (release)
/usr/local/lib/gcc-lib/alphaev6-unknown-linux-gnu/2.95.2/cpp -lang-c++ -v -I/usr/X11R6/include -I/usr/local/src/qttest/include -I/usr/X11R6/include -I/usr/local/src/qttest/src/3rdparty/zlib -I/usr/local/src/qttest/src/3rdparty/libpng -D__GNUC__=2 -D__GNUG__=2 -D__GNUC_MINOR__=95 -D__cplusplus -Dlinux -Dunix -D_LONGLONG -D__alpha__ -D__ELF__ -D__linux__ -D__unix__ -D_LONGLONG -D__alpha__ -D__ELF__ -D__linux -D__unix -Asystem(linux) -D__EXCEPTIONS -D__OPTIMIZE__ -D__LANGUAGE_C__ -D__LANGUAGE_C -DLANGUAGE_C -Acpu(alpha) -Amachine(alpha) -D__alpha -D__alpha__ -D__alpha_ev6__ -Acpu(ev6) -D__alpha_bwx__ -Acpu(bwx) -D__alpha_max__ -Acpu(max) -D__alpha_fix__ -Acpu(fix) -DQT_BUILTIN_GIF_READER=0 -DQT_NO_IMAGEIO_JPEG -DQT_NO_IMAGEIO_MNG moc_qlistview2.cpp moc_qlistview2.ii
GNU CPP version 2.95.2 19991024 (release) (Alpha GNU/Linux for ELF)
#include "..." search starts here:
#include <...> search starts here:
/usr/X11R6/include
/usr/local/src/qttest/include
/usr/X11R6/include
/usr/local/src/qttest/src/3rdparty/zlib
/usr/local/src/qttest/src/3rdparty/libpng
/usr/local/lib/gcc-lib/alphaev6-unknown-linux-gnu/2.95.2/../../../../include/g++-3
/usr/local/include
/usr/local/lib/gcc-lib/alphaev6-unknown-linux-gnu/2.95.2/../../../../alphaev6-unknown-linux-gnu/include
/usr/local/lib/gcc-lib/alphaev6-unknown-linux-gnu/2.95.2/include
/usr/include
End of search list.
The following default directories have been omitted from the search path:
End of omitted list.
/usr/local/lib/gcc-lib/alphaev6-unknown-linux-gnu/2.95.2/cc1plus moc_qlistview2.ii -quiet -dumpbase moc_qlistview2.cc -O2 -version -fPIC -o moc_qlistview2.s
GNU C++ version 2.95.2 19991024 (release) (alphaev6-unknown-linux-gnu) compiled by GNU C version 2.95.2 19991024 (release).
/usr/local/alphaev6-unknown-linux-gnu/bin/as -o moc_qlistview2.o moc_qlistview2.s
Dr. Tom Holroyd
"I am, as I said, inspired by the biological phenomena in which
chemical forces are used in repetitious fashion to produce all
kinds of weird effects (one of which is the author)."
-- Richard Feynman, _There's Plenty of Room at the Bottom_
moc_qlistview2.ii.bz2