Bug 36474 - [4.3 Regression] GCC takes forever to compile a certain file
Summary: [4.3 Regression] GCC takes forever to compile a certain file
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.3.1
: P3 normal
Target Milestone: 4.3.2
Assignee: Richard Biener
URL:
Keywords: compile-time-hog, memory-hog
Depends on:
Blocks:
 
Reported: 2008-06-09 10:10 UTC by Frank Mehnert
Modified: 2008-06-11 09:17 UTC (History)
2 users (show)

See Also:
Host:
Target: i?86-*-*
Build:
Known to work: 4.2.4 4.4.0
Known to fail: 4.3.1
Last reconfirmed: 2008-06-09 13:02:04


Attachments
VBoxManage.cpp (preprocessed with -E -dD and compressed) from current VirtualBox SVN. (244.31 KB, text/plain)
2008-06-09 10:15 UTC, Frank Mehnert
Details
unincluded testcase (113.42 KB, application/octet-stream)
2008-06-09 13:01 UTC, Richard Biener
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Frank Mehnert 2008-06-09 10:10:55 UTC
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)
Comment 1 Frank Mehnert 2008-06-09 10:15:12 UTC
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).
Comment 2 Richard Biener 2008-06-09 12:22:33 UTC
Seems to be "stuck" processing

int handleModifyVM(int, char**, ComPtr<IVirtualBox, ComStrongRef>, ComPtr<ISession, ComStrongRef>)

Comment 3 Richard Biener 2008-06-09 12:58:01 UTC
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.
Comment 4 Richard Biener 2008-06-09 13:01:53 UTC
Created attachment 15742 [details]
unincluded testcase
Comment 5 Richard Biener 2008-06-09 13:02:04 UTC
We can fix -O1 for 4.3.
Comment 6 Richard Biener 2008-06-11 09:17:00 UTC
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

Comment 7 Richard Biener 2008-06-11 09:17:20 UTC
Fixed as far as possible.