From mboxrd@z Thu Jan 1 00:00:00 1970 From: mark.dewing@intel.com To: gcc-gnats@gcc.gnu.org Subject: c/2583: A function declared __inline__ takes exponential compile time on IA64 Date: Wed, 18 Apr 2001 15:16:00 -0000 Message-id: <20010418221047.13856.qmail@sourceware.cygnus.com> X-SW-Source: 2001-04/msg00331.html List-Id: >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: