Bug 2391 - Exponential compilation time explosion in combine
|
Bug#:
2391
|
Product: gcc
|
Version: 3.1
|
|
Host: sparc-sun-solaris2.5.1
|
Target: arm-unknown-elf
|
Build: sparc-sun-solaris2.5.1
|
|
Status: RESOLVED
|
Severity: normal
|
Priority: P3
|
|
Resolution: FIXED
|
Assigned To: nemet@gcc.gnu.org
|
Reported By: rearnsha@arm.com
|
|
Component: rtl-optimization
|
Target Milestone: ---
|
|
Summary: Exponential compilation time explosion in combine
|
|
Keywords:
|
|
Opened: 2001-03-26 02:36
|
The following code, when compiled with optimization on gcc/arm (any
configuration), demonstrates an exponential time behaviour in combine.
Each additional statement doubles the length of the compilation. This
is a long-standing problem that dates back to at least gcc-2.8
Release:
3.1 20010323 (experimental)
Environment:
System: SunOS sun18 5.7 Generic_106541-11 sun4u sparc SUNW,Ultra-5_10
Architecture: sun4
host: sparc-sun-solaris2.5.1
build: sparc-sun-solaris2.5.1
target: arm-unknown-elf
configured with: /home/rearnsha/gnusrc/egcs-cross/configure --target=arm-elf --with-headers=/home/rearnsha/gnusrc/utils/newlib/libc/include --prefix=/home/rearnsha/gnu/egcs/install/SunOS5
How-To-Repeat:
Compile the following test case on arm-elf (or any other ARM target):
arm-elf-gcc -O test.c
unsigned mhz_2(register long n, unsigned a)
{
for (; n > 0; --n) {
a^=a+a; a^=a+a; a^=a+a; a^=a+a; a^=a+a;
a^=a+a; a^=a+a; a^=a+a; a^=a+a; a^=a+a;
a^=a+a; a^=a+a; a^=a+a; a^=a+a; a^=a+a;
a^=a+a; a^=a+a; a^=a+a; a^=a+a; a^=a+a;
a^=a+a; a^=a+a; a^=a+a; a^=a+a; a^=a+a;
a^=a+a; a^=a+a; a^=a+a; a^=a+a; a^=a+a;
a^=a+a; a^=a+a; a^=a+a; a^=a+a; a^=a+a;
a^=a+a; a^=a+a; a^=a+a; a^=a+a; a^=a+a;
a^=a+a; a^=a+a; a^=a+a; a^=a+a; a^=a+a;
a^=a+a; a^=a+a; a^=a+a; a^=a+a; a^=a+a;
a^=a+a; a^=a+a; a^=a+a; a^=a+a; a^=a+a;
a^=a+a; a^=a+a; a^=a+a; a^=a+a; a^=a+a;
a^=a+a; a^=a+a; a^=a+a; a^=a+a; a^=a+a;
a^=a+a; a^=a+a; a^=a+a; a^=a+a; a^=a+a;
a^=a+a; a^=a+a; a^=a+a; a^=a+a; a^=a+a;
a^=a+a; a^=a+a; a^=a+a; a^=a+a; a^=a+a;
a^=a+a; a^=a+a; a^=a+a; a^=a+a; a^=a+a;
a^=a+a; a^=a+a; a^=a+a; a^=a+a; a^=a+a;
a^=a+a; a^=a+a; a^=a+a; a^=a+a; a^=a+a;
a^=a+a; a^=a+a; a^=a+a; a^=a+a; a^=a+a;
}
return a;
}
Fix:
Fixed by:
2003-02-13 Adam Nemet <anemet@lnxw.com>
PR opt/2391
* combine.c: Fix spelling in comment.
(cached_nonzero_bits): New function.
(cached_num_sign_bit_copies): New function.
(nonzero_bits_with_known): New macro.
(num_sign_bit_copies_with_known): New macro.
(nonzero_bits1): Rename from nonzero_bits. Add three new
arguments. Change calls from nonzero_bits to
nonzero_bits_with_known.
(num_sign_bit_copies1): Rename from num_sign_bit_copies. Add
three new arguments. Change calls from num_sign_bit_copies to
num_sign_bit_copies_with_known.
(nonzero_bits): New macro.
(num_sign_bit_copies): New macro.
(update_table_tick): Don't traverse identical subexpression more
than once.
(get_last_value_validate): Likewise.
Mainline:
http://gcc.gnu.org/ml/gcc-cvs/2003-02/msg00691.html
3.3 brach:
http://gcc.gnu.org/ml/gcc-cvs/2003-02/msg00758.html
Responsible-Changed-From-To: unassigned->nemet
Responsible-Changed-Why: .
State-Changed-From-To: open->closed
State-Changed-Why: Fixed.