This is the mail archive of the gcc@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] | |
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
Attachment:
msg00535/pgp00000.pgp
Description: PGP signature
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |