The following command line causes the gcc/g++ driver front-end to crash with a
core dump (segmentation fault):
gcc -O -O -O -O -O -O -O -O -O -O -O -O -O -O -O -O -O -O -O -O -Wall -Wall
hello.cpp
Note: The example is only meant as easy to reproduce failing case. Actually the
problem occured in a command line with mixed options that happened to repeat
-Wall two times and by accident had the "right" number of other options -D, -I,
... in a qmake-generated Makefile.
The EXACT number of command line options is critical: with more or with lesser
options the problem is NOT triggered.
Also the option -Wall may be mixed with the others, as long as it appears
exactly two times OR three times.
For further info complete -v output:
Configured with:
/gnu/gcc/releases/respins/4.3.4-3a/gcc4-4.3.4-3/src/gcc-4.3.4/configure
--srcdir=/gnu/gcc/releases/respins/4.3.4-3a/gcc4-4.
3.4-3/src/gcc-4.3.4 --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin
--sbindir=/usr/sbin --libexecdir=/usr/lib --datadir=/usr/share --loca
lstatedir=/var --sysconfdir=/etc --infodir=/usr/share/info
--mandir=/usr/share/man --datadir=/usr/share --infodir=/usr/share/info
--mandir=/
usr/share/man -v --with-gmp=/usr --with-mpfr=/usr --enable-bootstrap
--enable-version-specific-runtime-libs --with-slibdir=/usr/bin --libexe
cdir=/usr/lib --enable-static --enable-shared --enable-shared-libgcc
--disable-__cxa_atexit --with-gnu-ld --with-gnu-as --with-dwarf2 --disa
ble-sjlj-exceptions --enable-languages=ada,c,c++,fortran,java,objc,obj-c++
--disable-symvers --enable-libjava --program-suffix=-4 --enable-l
ibgomp --enable-libssp --enable-libada --enable-threads=posix --with-arch=i686
--with-tune=generic --enable-libgcj-sublibs CC=gcc-4 CXX=g++-
4 CC_FOR_TARGET=gcc-4 CXX_FOR_TARGET=g++-4 GNATMAKE_FOR_TARGET=gnatmake
GNATBIND_FOR_TARGET=gnatbind --with-ecj-jar=/usr/share/java/ecj.jar
Thread model: posix
gcc version 4.3.4 20090804 (release) 1 (GCC)
--
Summary: Driver core dump (when duplicating -Wall command line
option
Product: gcc
Version: 4.3.4
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: driver
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: Martin dot Weitzel at t-online dot de
GCC build triplet: Configured with: ... (see body)
GCC host triplet: gcc version 4.3.4 20090804 (release) 1 (GCC)
GCC target triplet: Target: i686-pc-cygwin
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45754