Compiling VirtualBox with gcc version 4.3.1 the C++ compiler takes forever running at 100% when compiling the file VBoxManage.c. It compiles fine with -O0 but takes forever with -O1. I will attach the pre-processed file. This is a regression since some weeks, sorry, I cannot report the exact version of gcc 4.3 when it started to fail. Older gcc compilers work. $ gcc -v Using built-in specs. Target: i486-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Debian 4.3.1-1' --with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.3 --program-suffix=-4.3 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --enable-targets=all --enable-cld --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu Thread model: posix gcc version 4.3.1 (Debian 4.3.1-1)
Created attachment 15740 [details] VBoxManage.cpp (preprocessed with -E -dD and compressed) from current VirtualBox SVN. If you compile this file with g++ -c -o foo.o -O0 -fshort-wchar VBoxManage.cpp it will be compiled successfully. It you compile it with g++ -c -o foo.o -O1 -fshort-wchar VBoxManage.cpp (gcc 4.3.1) the g++ compiler will loop forever (aborted after 5 minutes).
Seems to be "stuck" processing int handleModifyVM(int, char**, ComPtr<IVirtualBox, ComStrongRef>, ComPtr<ISession, ComStrongRef>)
Confirmed. -fno-inline "fixes" it, but not -fno-tree-fre or -fno-tree-dominator-opts. --param max-fields-for-field-sensitive=0 fixes it (disabling SFTs and field-sensitive PTA) as well.
Created attachment 15742 [details] unincluded testcase
We can fix -O1 for 4.3.
Subject: Bug 36474 Author: rguenth Date: Wed Jun 11 09:16:09 2008 New Revision: 136656 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=136656 Log: 2008-06-11 Richard Guenther <rguenther@suse.de> PR tree-optimization/36474 * opts.c (decode_options): Set max-fields-for-field-sensitive parameter to 100 for -O2, -Os and -O3. * params.def (max-fields-for-field-sensitive): Set default to zero. * doc/invoke.texi (max-fields-for-field-sensitive): Document defaults. * gcc.dg/tree-ssa/alias-15.c: Adjust testcase. Modified: branches/gcc-4_3-branch/gcc/ChangeLog branches/gcc-4_3-branch/gcc/doc/invoke.texi branches/gcc-4_3-branch/gcc/opts.c branches/gcc-4_3-branch/gcc/params.def branches/gcc-4_3-branch/gcc/testsuite/ChangeLog branches/gcc-4_3-branch/gcc/testsuite/gcc.dg/tree-ssa/alias-15.c
Fixed as far as possible.