gcc segfaults when compiling the following attached code, using the command as follows: gcc -g -Wall -c foo.cc -o foo.o You can do without most of the parameters, the -c foo.cc is important though :). gcc version is 3.4.4-r1. gcc -v: Reading specs from /usr/lib/gcc/i686-pc-linux-gnu/3.4.4/specs Configured with: /var/tmp/portage/gcc-3.4.4-r1/work/gcc-3.4.4/configure --prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/3.4.4 --includedir=/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/include --datadir=/usr/share/gcc-data/i686-pc-linux-gnu/3.4.4 --mandir=/usr/share/gcc-data/i686-pc-linux-gnu/3.4.4/man --infodir=/usr/share/gcc-data/i686-pc-linux-gnu/3.4.4/info --with-gxx-include-dir=/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/include/g++-v3 --host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --disable-altivec --disable-nls --with-system-zlib --disable-checking --disable-werror --disable-libunwind-exceptions --disable-multilib --disable-libmudflap --disable-libgcj --enable-languages=c,c++ --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu Thread model: posix gcc version 3.4.4 (Gentoo 3.4.4-r1, ssp-3.4.4-1.0, pie-8.7.8) emerge info: Portage 2.0.54 (default-linux/x86/2005.1, gcc-3.4.4, glibc-2.3.5-r2, 2.6.14.3-swsusp i686) ================================================================= System uname: 2.6.14.3-swsusp i686 Mobile Intel(R) Pentium(R) 4 CPU 3.06GHz Gentoo Base System version 1.6.13 dev-lang/python: 2.3.5-r2, 2.4.2 sys-apps/sandbox: 1.2.12 sys-devel/autoconf: 2.13, 2.59-r6 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1 sys-devel/binutils: 2.16.1 sys-devel/libtool: 1.5.20 virtual/os-headers: 2.6.11-r2 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CBUILD="i686-pc-linux-gnu" CFLAGS="-march=pentium4 -O2 -pipe" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-march=pentium4 -O2 -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig ccache distlocks sandbox sfperms strict" GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.rucus.ru.ac.za/gentoo-portage" USE="x86 X alsa apache2 apm audiofile avi bash-completion berkdb bitmap-fonts bzip2 cdr cups dba dvd eds emboss encode ethereal exif expat fam ffmpeg foomaticdb gd gdbm gif glut gpm gstreamer gtk gtk2 idn imagemagick imlib jack jpeg lcms ldap libg++ libwww mad mikmod mmx mng motif mozilla mp3 mpeg mysql ncurses nptl nptlonly ogg oggvorbis opengl pam pcre pdflib php png postgres qt quicktime readline rtc samba sdl slang spell sse sse2 ssl svga tiff truetype truetype-fonts type1-fonts udev usb userlocales vorbis xine xml2 xmms xv xvid zlib userland_GNU kernel_linux elibc_glibc" Unset: ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS
Created attachment 80242 [details] foo.cc Find attached the code that segfaults gcc.
Created attachment 80243 [details] preprocessed foo.cc As requested in the compiler output: $ g++ -g -Wall -c foo.cc -o foo.o foo.cc: In function `int main()': foo.cc:8: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://bugs.gentoo.org/> for instructions. Preprocessed source stored into /tmp/ccBcBGRF.out file, please attach this to your bugreport. (Note that the segfault occurs when using either gcc or g++).
looks like a crash in the error handling routine ... we've got some bugs open about this already, may be related/dupe ...
Just a note: this is still broken with 3.4.5, and works with >=4.0. I'll see if I can't find the fix in svn and backport it some point this weekend.
Alright, found the patch. Just added it to CVS so it will be in the next gcc-3.4.x that we release, most likely 3.4.6 since that should be out very soon.
Awesome, thanks.