The attached code takes 20 mins to compile on a Linux/Fedora 9 box when using -O optimization, but only 21 seconds when using -O0 [pletzer@quartic cxxps]$ time g++ -O -ftime-report -fmem-report -c cxxps.cpp >& stat.txt real 21m41.494s user 16m24.774s sys 0m19.713s [pletzer@quartic cxxps]$ time g++ -O0 -ftime-report -fmem-report -c cxxps.cpp >& stat.txt real 0m21.391s user 0m17.666s sys 0m2.453s
Created attachment 17681 [details] source code reproducing problem I apologize but I cannot produce *.i files with -save-temps: [pletzer@localhost test]$ g++ -c -save-temps cxxps.cpp [pletzer@localhost test]$ ls ccps_base.h cxxps.cpp cxxps.o f77name.h ccps.h cxxps.h cxxps.tmp.localhost.localdomain.10206.s multiarray.h so I'm sending the source and headers as a bz2 compressed file. To reproduce the problem of very long compile time, type tar xvfj cxxps.bz2 g++ -c -O cxxps.cpp
tree memory partitioning: 51.43 (20%) usr 0.26 ( 9%) sys 51.80 (20%) wall 19 kB ( 0%) ggc tree operand scan : 149.30 (58%) usr 1.20 (43%) sys 151.17 (57%) wall 18536 kB ( 4%) ggc 4.4 uses tree memory partitioning: 42.43 (26%) usr 0.33 (14%) sys 42.84 (26%) wall 13 kB ( 0%) ggc tree operand scan : 71.91 (45%) usr 0.59 (25%) sys 72.88 (44%) wall 14670 kB ( 3%) ggc trunk does not have the above on the radar at all. thus ... *** This bug has been marked as a duplicate of 33237 ***