excessive inlining due to state hack
The program at https://gist.github.com/jorendorff/a3005968adc8f054baf7 runs very slowly when compiled with -O
or higher. It seems that arr
and/or rangeMap
is being inlined into the do block on lines 89-91 and recomputed for each iteration of the loop. The program runs nearly instantly when compiled with -O0
or with -O -fno-pre-inlining
. (Of course, this does not mean -fpre-inlining
is necessary the culprit; it could be enabling some subsequent misoptimization.)
Trac metadata
Trac field | Value |
---|---|
Version | 7.8.3 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |