3.0 + optimization miscompiles groff-1/17.1

David Ronis ronis@ronispc.chem.mcgill.ca
Wed Jun 27 08:44:00 GMT 2001


groff-1.17.1 on an i686-linux(2.4.5)-gnu(2.1.3) box when compiled with

/usr/bin/gcc -v
Reading specs from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.0.1/specs
Configured with: ../gcc/configure --host=i686-pc-linux-gnu --prefix=/usr --with-gnu-as --enable-shared --with-gnu-ld --enable-threads=posix
Thread model: posix
gcc version 3.0.1 20010619 (prerelease)

and optimized CXXFLAGS:

-O3 -march=i686 -ffast-math -funroll-loops -fomit-frame-pointer
 -fforce-mem -fforce-addr -malign-jumps=3 -malign-loops=3
 -malign-functions=3 -mpreferred-stack-boundary=3 -fpermissive

results in a program that SIGSEGV's.  

I tried the following:

		groff -man -Tlatin1 some_man_page.man

I also tried adding -g to the above flags in order to see where the
SIGSEGV is happening, but the resulting backtrace never told me where
in the code it was. [It pointed to wait4 in libc, and nothing else].

If I compile with gcc-2.95.3, the resulting code works.  Similarly, if
I use the default flags when building groff, it also works.

Something's wrong with optimization on ix86's (as was indicated in the
testsuite results).

David



More information about the Gcc-bugs mailing list