This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: c/1687: [3.3/3.4 regression] Extreme compile time regressionfrom 2.95.3


Hi,

The GCC C front end shows exponential behavior in time for this
code with -finline-functions.  The time is spent in walk_tree but
the problem may be elsewhere, I haven't looked at that yet.

--------------------------------
typedef int bool;
bool in0, in1, in2, in3, in4, in5, in6, in7, in8, in9;
unsigned long output;

void mux(void)
{
 output =
     (in0   ?  0x00000001 : 0) | (in1   ?  0x00000008 : 0) |
     (in2   ?  0x00000001 : 0) | (in3   ?  0x00000008 : 0) |
     (in4   ?  0x00000001 : 0) | (in5   ?  0x00000008 : 0) |
     (in6   ?  0x00000001 : 0) | (in7   ?  0x00000008 : 0) |
     (in8   ?  0x00000001 : 0) | (in9   ?  0x00000008 : 0)
 ;
}
--------------------------------

This function has 10 variables "int ii??".  I have similair programs
with 11, 12, 13, 14 and 15 "int ii??" variables (I started with 32,
like the original test case, but it ate memory until it died).

Here is the output for "time cc1 -quiet -O -finline-functions":

# of in??      log(user+sys)   user+sys    user    sys
10                -0.284         0.52      0.49    0.03
11                 0.130         1.35      1.35    0
12                 0.590         3.89      3.87    0.02
13                 1.059        11.47     11.47    0
14                 1.534        34.23     34.21    0.02
15                 2.012       102.92    102.88    0.04

GNU C version 3.4 20030417 (experimental) (i586-pc-linux-gnu)
   compiled by GNU C version 2.95.3 20010315 (SuSE).
GGC heuristics: --param ggc-min-expand=42 --param ggc-min-heapsize=23891

The C++ front end does not show this behavior.

Greetz
Steven

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=1687



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]