performance bug or known gcc-3.2 limit?

Robert Schiele rschiele@uni-mannheim.de
Fri Jul 12 12:13:00 GMT 2002


Hello.

When compiling a program with a real huge switch statement, current
head revision takes almost infinite time.

To reproduce, build such a program by something like:

# ( echo 'void f(); void a() { int b; c: switch (b) {'
> for i in `seq 1 10000`; do echo 'case '$i': f(); goto c;'; done
> echo '}}' ) > inf.c

which results in something like:

void f(); void a() { int b; c: switch (b) {
case 1: f(); goto c;
case 2: f(); goto c;
case 3: f(); goto c;
...
case 9998: f(); goto c;
case 9999: f(); goto c;
case 10000: f(); goto c;
}}

Compiling the generated files with different compilers and platforms
by

# gcc -S inf.c -o inf.s

results in:

i486-suse-linux (AMD Athlon(tm) XP 1800+):
  gcc-2.95.3: 0m0.520s
  gcc-3.1:    0m5.210s
  gcc-3.2:    stopped after 30 Minutes

sparc-suse-linux (Ultra 10):
  gcc-2.95.3: 0m2.370s
  gcc-3.1:    0m12.100s
  gcc-3.2:    stopped after 30 Minutes

sparc-sun-solaris2.9 (Ultra 5):
  gcc-2.95.3: 0m2.130s
  gcc-3.1:    0m13.690s
  gcc-3.2:    stopped after 30 Minutes

Is this an overfull hash or what does produce those results? Is this a
thing we have to live with or can this be fixed?

We have such a construction (not that simple than the sample above ;-)
in our automatically generated execution engine of our database
system.

If you need more information, send me a mail.

Robert

-- 
Robert Schiele			Tel.: +49-621-181-2517
Dipl.-Wirtsch.informatiker	mailto:rschiele@uni-mannheim.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 524 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20020712/149dd422/attachment.sig>


More information about the Gcc mailing list