optimization/4921: gcc-3.0.1 and 3.0.2 generate wrong code with -O2
er@openoffice.org
er@openoffice.org
Mon Nov 12 00:57:00 GMT 2001
>Number: 4921
>Category: optimization
>Synopsis: gcc-3.0.1 and 3.0.2 generate wrong code with -O2
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: unassigned
>State: open
>Class: wrong-code
>Submitter-Id: net
>Arrival-Date: Wed Nov 21 07:16:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator: er@openoffice.org
>Release: gcc-3.0.1
>Organization:
>Environment:
Linux x86 (SuSE 7.3 - Kernel 2.4.10-4GB)
>Description:
The assembler code generated only partly initializes the ScRange object.
The Row constants (43 and 46) are written to the ScAddress locations
after the ScRange object is constructed with the ScAddress objects.
I set this to high priority because we have quite a few optimization
problems in our build of OpenOffice.org with gcc3 (problems we didn't
have with 2.95.3) and are now forced to use -O1 instead of -O2 to get
rid of them which of course has great impact on code size and speed.
g++ -v output:
Reading specs from /develop6/update/dev/gcc_3.0.1_linux_libc2.11/lib/gcc-lib/i686-pc-linux-gnu/3.0.1/specs
Configured with: ./configure --prefix=/develop6/update/dev/gcc_3.0.1_linux_libc2.11 --with-gnu-as --with-as-pathname=/develop6/update/dev/gcc_3.0.1_linux_libc2.11/bin/as --with-gnu-ld --with-ld-pathname=/develop6/update/dev/gcc_3.0.1_linux_libc2.11/bin/ld --enable-languages=c++ --enable-threads
Thread model: posix
gcc version 3.0.1
/develop6/update/dev/gcc_3.0.1_linux_libc2.11/lib/gcc-lib/i686-pc-linux-gnu/3.0.1/cpp0 -lang-c++ -D__GNUG__=3 -D__GXX_DEPRECATED -D__EXCEPTIONS -D__GXX_ABI_VERSION=100 -v -D__GNUC__=3 -D__GNUC_MINOR__=0 -D__GNUC_PATCHLEVEL__=1 -D__ELF__ -Dunix -Dlinux -D__ELF__ -D__unix__ -D__linux__ -D__unix -D__linux -Asystem=posix -D__OPTIMIZE__ -D__STDC_HOSTED__=1 -Wall -D_GNU_SOURCE -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i686__ -D__tune_pentiumpro__ gcc3bug.cxx gcc3bug.ii
GNU CPP version 3.0.1 (cpplib) (i386 Linux/ELF)
ignoring nonexistent directory "/develop6/update/dev/gcc_3.0.1_linux_libc2.11/i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
/develop6/update/dev/gcc_3.0.1_linux_libc2.11/include/g++-v3
/develop6/update/dev/gcc_3.0.1_linux_libc2.11/include/g++-v3/i686-pc-linux-gnu
/develop6/update/dev/gcc_3.0.1_linux_libc2.11/include/g++-v3/backward
/usr/local/include
/develop6/update/dev/gcc_3.0.1_linux_libc2.11/lib/gcc-lib/i686-pc-linux-gnu/3.0.1/include
/usr/include
End of search list.
/develop6/update/dev/gcc_3.0.1_linux_libc2.11/lib/gcc-lib/i686-pc-linux-gnu/3.0.1/cc1plus -fpreprocessed gcc3bug.ii -quiet -dumpbase gcc3bug.cxx -O2 -Wall -version -o gcc3bug.s
GNU CPP version 3.0.1 (cpplib) (i386 Linux/ELF)
GNU C++ version 3.0.1 (i686-pc-linux-gnu)
compiled by GNU C version 3.0.1.
/develop6/update/dev/gcc_3.0.1_linux_libc2.11/lib/gcc-lib/i686-pc-linux-gnu/3.0.1/../../../../i686-pc-linux-gnu/bin/as -V -Qy -o gcc3bug.o gcc3bug.s
GNU assembler version 2.11.2 (i686-pc-linux-gnu) using BFD version 2.11.2
/develop6/update/dev/gcc_3.0.1_linux_libc2.11/lib/gcc-lib/i686-pc-linux-gnu/3.0.1/collect2 -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 /usr/lib/crt1.o /usr/lib/crti.o /develop6/update/dev/gcc_3.0.1_linux_libc2.11/lib/gcc-lib/i686-pc-linux-gnu/3.0.1/crtbegin.o -L/develop6/update/dev/gcc_3.0.1_linux_libc2.11/lib/gcc-lib/i686-pc-linux-gnu/3.0.1 -L/develop6/update/dev/gcc_3.0.1_linux_libc2.11/lib/gcc-lib/i686-pc-linux-gnu/3.0.1/../../../../i686-pc-linux-gnu/lib -L/develop6/update/dev/gcc_3.0.1_linux_libc2.11/lib/gcc-lib/i686-pc-linux-gnu/3.0.1/../../.. gcc3bug.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /develop6/update/dev/gcc_3.0.1_linux_libc2.11/lib/gcc-lib/i686-pc-linux-gnu/3.0.1/crtend.o /usr/lib/crtn.o
>How-To-Repeat:
Compile attached gcc3bug.ii with -O2 and run program.
a1,a2 and the members of a3 are not identical.
>Fix:
compile with -O1
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the Gcc-bugs
mailing list