This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c/2583: A function declared __inline__ takes exponential compile time on IA64
- To: gcc-gnats at gcc dot gnu dot org
- Subject: c/2583: A function declared __inline__ takes exponential compile time on IA64
- From: mark dot dewing at intel dot com
- Date: 18 Apr 2001 22:10:47 -0000
- Reply-To: mark dot dewing at intel dot com
>Number: 2583
>Category: c
>Synopsis: A function declared __inline__ takes exponential compile time on IA64
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Apr 18 15:16:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: Mark Dewing
>Release: gcc version 3.0 20010402
>Organization:
>Environment:
IA64 Linux 2.4.0test10-001115-58smp
>Description:
A function with some integer arithmetic operations is declared with the __inline__ specifier. With -O or higher, it takes a long time to compile on IA64. In particular, it is exponential in the number of statements
(count *= 10;) in the function.
The x86 gcc (same 200010402 snapshot) does not have this behavior.
>How-To-Repeat:
// compile with -O or higher
int count = 1; // no problem with double
static __inline__ void
toobig(void ) {
count *= 10; // also depends on this value
count *= 10; // takes more time for larger values
// 2
count *= 10;
count *= 10;
// 4
count *= 10;
count *= 10;
// 6
count *= 10;
count *= 10;
// 8
count *= 10;
count *= 10;
// 10
count *= 10;
count *= 10;
// 12
count *= 10;
count *= 10;
// 14
count *= 10;
count *= 10;
// 16
count *= 10;
// 17
count *= 10;
// 18
count *= 10;
// 19
count *= 10;
// 20
count *= 10;
// 21
#if 0
count *= 2;
// 22
count *= 10;
// 23
count *= 10;
// 24
#endif
}
int main(){
toobig();
printf("count = %d\n",count);
}
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: