c++/615: 40-fold increase in compilation time for simple function (ss20001002)

wolfgang.bangerth@iwr.uni-heidelberg.de wolfgang.bangerth@iwr.uni-heidelberg.de
Fri Oct 6 06:36:00 GMT 2000


>Number:         615
>Category:       c++
>Synopsis:       40-fold increase in compilation time for simple function (ss20001002)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Oct 06 06:36:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Wolfgang Bangerth
>Release:        unknown-1.0
>Organization:
>Environment:
Linux 2.2.14, SuSE 6
AMD Athlon Processor
egcs-20001002/lib/gcc-lib/i686-pc-linux-gnu/2.97/specs
>Description:
The following code, simplified from something that was
generated automatically shows a 40-fold increase in
compilation time for the latest snapshot (2000/10/02)
compared to gcc2.95.2 (it takes 12 seconds, compared to
0.3 seconds previously), when compiled with -O1.

The function in question has some 90 lines of code, for which
I think 12 seconds are quite long. If some of the
computations are deleted, the much larger compilation
times remain, but it becomes harder to measure the
difference, so I left them in. For finding out the cause,
it may however be helpful to skip some lines; it does not
seem to make much difference which lines are deleted.

It may or may not be of interest to know that if we make the
array x[1] a scalar (since we only access its first element),
then the large compile times vanish. Likewise, if we do
not initialize x[0] by a function call, but directly.
>How-To-Repeat:
Compile with 
    c++ -c -O1 tria_accessor_3d.cc
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="tria_accessor_3d.cc"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="tria_accessor_3d.cc"

Y2xhc3MgUG9pbnQKewogIHB1YmxpYzoKICAgIGRvdWJsZSAmIG9wZXJhdG9yICgpIChjb25zdCB1
bnNpZ25lZCBpbnQgaW5kZXgpOwp9OwoKUG9pbnQgJiB2ZXJ0ZXggKHVuc2lnbmVkIGludCk7CgoK
ZG91YmxlIGZvbyAoKQp7CiAgY29uc3QgZG91YmxlIHhbMV0gP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F0qeFswXSp4WzBdLXgK
WzBdKnhbMF0qeFswXSp4WzBdKzIuMCp4WzBdKnhbMF0qeFswXSp4WzBdKzIuMCp4WzBdKnhbMF0q
eFswXSp4WzBdLTIuMCp4WzBdKngKWzBdKnhbMF0qeFswXSt4WzBdKnhbMF0qeFswXSp4WzBdLXhb
MF0qeFswXSp4WzBdKnhbMF07CgogIHM1ID0gczgreFswXSp4WzBdKnhbMF0reFswXSp4WzBdKnhb
MF0reFswXSp4WzBdKnhbMF0teFswXSp4WzBdKnhbMF0reFswXSoKeFswXSp4WzBdLXhbMF0qeFsw
XSp4WzBdLXhbMF0qeFswXSp4WzBdK3hbMF0qeFswXSp4WzBdK3hbMF0qeFswXSp4WzBdK3hbMF0q
eFswXQoqeFswXSt4WzBdKnhbMF0qeFswXSt4WzBdKnhbMF0qeFswXSt4WzBdKnhbMF0qeFswXS14
WzBdKnhbMF0qeFswXS14WzBdKnhbMF0qeApbMF0reFswXSp4WzBdKnhbMF0reFswXSp4WzBdKnhb
MF0teFswXSp4WzBdKnhbMF0rczc7CiAgczQgPSAxL3M1OwogIHMyID0gczMqczQ7CiAgcmV0dXJu
IHMyOwp9Owo=


More information about the Gcc-bugs mailing list