This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
optimization/2391: Exponential compilation time explosion in combine
- To: gcc-gnats at gcc dot gnu dot org
- Subject: optimization/2391: Exponential compilation time explosion in combine
- From: Richard Earnshaw <rearnsha at arm dot com>
- Date: Mon, 26 Mar 2001 11:26:29 +0100 (BST)
>Number: 2391
>Category: optimization
>Synopsis: Exponential compilation time explosion in combine
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Mar 26 02:36:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator: Richard Earnshaw
>Release: 3.1 20010323 (experimental)
>Organization:
ARM
>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
>Description:
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
>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:
Unknown.
>Release-Note:
>Audit-Trail:
>Unformatted: