This is the mail archive of the gcc-bugs@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]

[Bug tree-optimization/26854] Inordinate compile times on large routines



------- Comment #34 from lucier at math dot purdue dot edu  2007-11-14 19:04 -------
Subject: Re:  Inordinate compile times on large routines


On Nov 14, 2007, at 11:57 AM, dberlin at dberlin dot org wrote:

>> Memory usage peaked at 10.3GB (just from monitoring top).
>
> Any idea where?

Not really, but I ran cc1 through gdb to generate the following data;  
I hope it's helpful.

The first interrupt was when top was reporting:

30359 lucier    25   0 9935m 9.6g 4128 T    0 61.7   2:19.65 cc1

At the second point in the compile (relatively stable top reports of  
memory usage):

30359 lucier    25   0 4121m 4.0g 4352 T   21 25.4   2:58.86 cc1

This is with

euler-24% /pkgs/gcc-mainline/bin/gcc -v
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: ../../mainline/configure --prefix=/pkgs/gcc-mainline  
--enable-languages=c --enable-checking=release --with-gmp=/pkgs/ 
gmp-4.2.2 --with-mpfr=/pkgs/gmp-4.2.2
Thread model: posix
gcc version 4.3.0 20071113 (experimental) [trunk revision 130159] (GCC)

Brad


euler-23% !gdb
gdb /pkgs/gcc-mainline/libexec/gcc/x86_64-unknown-linux-gnu/4.3.0/cc1
GNU gdb Red Hat Linux (6.3.0.0-1.143.el4rh)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and  
you are
welcome to change it and/or distribute copies of it under certain  
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for  
details.
This GDB was configured as "x86_64-redhat-linux-gnu"...Using host  
libthread_db library "/lib64/tls/libthread_db.so.1".

(gdb) run -Wall -W -Wno-unused -O1 -fno-math-errno -fschedule-insns2 - 
fno-trapping-math -fno-strict-aliasing -fwrapv -fomit-frame-pointer - 
fPIC -ftime-report -fmem-report all.i
Starting program: /export/pkgs/gcc-mainline/libexec/gcc/x86_64- 
unknown-linux-gnu/4.3.0/cc1 -Wall -W -Wno-unused -O1 -fno-math-errno - 
fschedule-insns2 -fno-trapping-math -fno-strict-aliasing -fwrapv - 
fomit-frame-pointer -fPIC -ftime-report -fmem-report all.i
__sputc __istype __isctype __wcwidth ___H__20_all_2e_o1 ___init_proc  
____20_all_2e_o1
Analyzing compilation unit
Performing interprocedural optimizations
<visibility> <early_local_cleanups> {GC 294991k -> 188566k} <inline>  
<static-var> <pure-const>Assembling functions:
___H__20_all_2e_o1 {GC 382279k -> 277065k}
Program received signal SIGINT, Interrupt.
free_alloc_pool (pool=0xe7d8f60) at ../../../mainline/gcc/alloc- 
pool.c:199
199           free (block);
(gdb) where
#0  free_alloc_pool (pool=0xe7d8f60) at ../../../mainline/gcc/alloc- 
pool.c:199
#1  0x00000000004b12d3 in df_chain_remove_problem () at ../../../ 
mainline/gcc/df-problems.c:1935
#2  0x00000000004b1569 in df_chain_fully_remove_problem ()  
at ../../../mainline/gcc/df-problems.c:1981
#3  0x00000000004ad1a0 in df_finish_pass (verify=Variable "verify" is  
not available.
) at ../../../mainline/gcc/df-core.c:663
#4  0x000000000058791a in execute_one_pass (pass=0xc46960)  
at ../../../mainline/gcc/passes.c:1140
#5  0x0000000000587a60 in execute_pass_list (pass=0xc46960)  
at ../../../mainline/gcc/passes.c:1171
#6  0x0000000000587a75 in execute_pass_list (pass=0xc46840)  
at ../../../mainline/gcc/passes.c:1172
#7  0x0000000000587a75 in execute_pass_list (pass=0xc46d60)  
at ../../../mainline/gcc/passes.c:1172
#8  0x000000000062fae4 in tree_rest_of_compilation  
(fndecl=0x2a990e84e0) at ../../../mainline/gcc/tree-optimize.c:404
#9  0x000000000073a232 in cgraph_expand_function (node=0x2a9865da00)  
at ../../../mainline/gcc/cgraphunit.c:1151
#10 0x000000000073bc64 in cgraph_optimize () at ../../../mainline/gcc/ 
cgraphunit.c:1214
#11 0x000000000041225b in c_write_global_declarations () at ../../../ 
mainline/gcc/c-decl.c:8081
#12 0x00000000005fcfac in toplev_main (argc=Variable "argc" is not  
available.
) at ../../../mainline/gcc/toplev.c:1055
#13 0x00000030fd11c3fb in __libc_start_main () from /lib64/tls/libc.so.6
#14 0x000000000040423a in _start ()
#15 0x0000007fbffff4e8 in ?? ()
#16 0x000000000000001c in ?? ()
#17 0x000000000000000f in ?? ()
#18 0x0000007fbffff7b2 in ?? ()
#19 0x0000007fbffff7fb in ?? ()
#20 0x0000007fbffff801 in ?? ()
#21 0x0000007fbffff804 in ?? ()
#22 0x0000007fbffff810 in ?? ()
#23 0x0000007fbffff814 in ?? ()
#24 0x0000007fbffff824 in ?? ()
#25 0x0000007fbffff836 in ?? ()
#26 0x0000007fbffff849 in ?? ()
#27 0x0000007fbffff85e in ?? ()
#28 0x0000007fbffff866 in ?? ()
#29 0x0000007fbffff87b in ?? ()
#30 0x0000007fbffff881 in ?? ()
#31 0x0000007fbffff88f in ?? ()
#32 0x0000007fbffff89c in ?? ()
#33 0x0000000000000000 in ?? ()
(gdb) c
Continuing.

Program received signal SIGINT, Interrupt.
0x00000000004687c9 in bitmap_elt_insert_after (head=0x963b0f0,  
elt=0xd30a7a70, indx=561) at ../../../mainline/gcc/bitmap.c:203
203             if (element->next)
(gdb) where
#0  0x00000000004687c9 in bitmap_elt_insert_after (head=0x963b0f0,  
elt=0xd30a7a70, indx=561) at ../../../mainline/gcc/bitmap.c:203
#1  0x000000000046a19b in bitmap_ior_into (a=0x963b0f0, b=Variable  
"b" is not available.
) at ../../../mainline/gcc/bitmap.c:913
#2  0x00000000004adce6 in df_worklist_dataflow (dataflow=0x7829f20,  
blocks_to_consider=0x9c1f250, blocks_in_postorder=0x2ab81c6010,  
n_blocks=Variable "n_blocks" is not available.
)
     at ../../../mainline/gcc/df-core.c:875
#3  0x00000000004acd7e in df_analyze_problem (dflow=0x7829f20,  
blocks_to_consider=0x9c1f250, postorder=0x2ab81c6010, n_blocks=59465)
     at ../../../mainline/gcc/df-core.c:1060
#4  0x00000000004ad00a in df_analyze () at ../../../mainline/gcc/df- 
core.c:1150
#5  0x00000000008faee7 in if_convert () at ../../../mainline/gcc/ 
ifcvt.c:4045
#6  0x00000000008fb429 in rest_of_handle_if_after_combine ()  
at ../../../mainline/gcc/ifcvt.c:4161
#7  0x00000000005878c2 in execute_one_pass (pass=0xc4b620)  
at ../../../mainline/gcc/passes.c:1118
#8  0x0000000000587a60 in execute_pass_list (pass=0xc4b620)  
at ../../../mainline/gcc/passes.c:1171
#9  0x0000000000587a75 in execute_pass_list (pass=0xc46d60)  
at ../../../mainline/gcc/passes.c:1172
#10 0x000000000062fae4 in tree_rest_of_compilation  
(fndecl=0x2a990e84e0) at ../../../mainline/gcc/tree-optimize.c:404
#11 0x000000000073a232 in cgraph_expand_function (node=0x2a9865da00)  
at ../../../mainline/gcc/cgraphunit.c:1151
#12 0x000000000073bc64 in cgraph_optimize () at ../../../mainline/gcc/ 
cgraphunit.c:1214
#13 0x000000000041225b in c_write_global_declarations () at ../../../ 
mainline/gcc/c-decl.c:8081
#14 0x00000000005fcfac in toplev_main (argc=Variable "argc" is not  
available.
) at ../../../mainline/gcc/toplev.c:1055
#15 0x00000030fd11c3fb in __libc_start_main () from /lib64/tls/libc.so.6
#16 0x000000000040423a in _start ()
#17 0x0000007fbffff4e8 in ?? ()
#18 0x000000000000001c in ?? ()
#19 0x000000000000000f in ?? ()
#20 0x0000007fbffff7b2 in ?? ()
#21 0x0000007fbffff7fb in ?? ()
#22 0x0000007fbffff801 in ?? ()
#23 0x0000007fbffff804 in ?? ()
#24 0x0000007fbffff810 in ?? ()
#25 0x0000007fbffff814 in ?? ()
#26 0x0000007fbffff824 in ?? ()
#27 0x0000007fbffff836 in ?? ()
#28 0x0000007fbffff849 in ?? ()
#29 0x0000007fbffff85e in ?? ()
#30 0x0000007fbffff866 in ?? ()
#31 0x0000007fbffff87b in ?? ()
#32 0x0000007fbffff881 in ?? ()
#33 0x0000007fbffff88f in ?? ()
#34 0x0000007fbffff89c in ?? ()
#35 0x0000000000000000 in ?? ()
(gdb) c
Continuing.
___init_proc ____20_all_2e_o1 {GC 466968k -> 26603k}Memory still  
allocated at the end of the compilation process
Size   Allocated        Used    Overhead
8           4096          32         120
16            72k         18k       1584
128         2144k       2135k         29k
256         8192        1536         112
512         4096        1024          56
1024         112k        110k       1568
2048          28k         22k        392
4096          76k         76k       1064
8192          48k         48k        336
16384         32k         32k        112
32768         32k         32k         56
131072        256k        256k        112
262144        512k        512k        112
524288       1024k       1024k        112
1048576       2048k       2048k        112
192          616k        300k       8624
144           20k       3024         280
160          132k        115k       1848
432           28k         21k        392
96            66M         14M        925k
48          2100k       1172k         32k
208          420k        375k       5880
64          1288k       1237k         20k
32           176k         72k       3168
80            30M       2060k        422k
Total        107M         25M       1455k

String pool
entries         159225
identifiers     159225 (100.00%)
slots           262144
bytes           1995k (172k overhead)
table size      2048k
coll/search     0.8692
ins/search      0.2066
avg. entry      12.83 bytes (+/- 7.80)
longest entry   67

??? tree nodes created

(No per-node statistics)
Type hash: size 2039, 920 elements, 0.860000 collisions
DECL_DEBUG_EXPR  hash: size 16381, 0 elements, 1.303078 collisions
DECL_VALUE_EXPR  hash: size 1021, 0 elements, 0.000000 collisions

Execution times (seconds)
garbage collection    :   1.17 ( 0%) usr   0.00 ( 0%) sys   1.17  
( 0%) wall       0 kB ( 0%) ggc
callgraph construction:   0.79 ( 0%) usr   0.11 ( 1%) sys   0.92  
( 0%) wall   31928 kB ( 4%) ggc
callgraph optimization:   1.18 ( 0%) usr   0.00 ( 0%) sys   1.16  
( 0%) wall       6 kB ( 0%) ggc
ipa reference         :   0.22 ( 0%) usr   0.03 ( 0%) sys   0.25  
( 0%) wall       7 kB ( 0%) ggc
cfg cleanup           :   2.16 ( 1%) usr   0.00 ( 0%) sys   2.16  
( 0%) wall     162 kB ( 0%) ggc
trivially dead code   :   0.36 ( 0%) usr   0.00 ( 0%) sys   0.37  
( 0%) wall       0 kB ( 0%) ggc
df reaching defs      :  10.01 ( 4%) usr   3.74 (22%) sys  13.81  
( 3%) wall       0 kB ( 0%) ggc
df live regs          :   8.10 ( 3%) usr   0.01 ( 0%) sys   8.13  
( 2%) wall       0 kB ( 0%) ggc
df live&initialized regs:  93.27 (37%) usr   2.67 (16%) sys 204.59  
(41%) wall       0 kB ( 0%) ggc
df use-def / def-use chains:   8.56 ( 3%) usr   2.67 (16%) sys  11.27  
( 2%) wall       0 kB ( 0%) ggc
df reg dead/unused notes:   1.00 ( 0%) usr   0.01 ( 0%) sys   1.00  
( 0%) wall   10937 kB ( 1%) ggc
register information  :   0.52 ( 0%) usr   0.00 ( 0%) sys   0.52  
( 0%) wall       0 kB ( 0%) ggc
alias analysis        :   0.93 ( 0%) usr   0.01 ( 0%) sys   0.91  
( 0%) wall    7168 kB ( 1%) ggc
register scan         :   0.10 ( 0%) usr   0.00 ( 0%) sys   0.10  
( 0%) wall       4 kB ( 0%) ggc
rebuild jump labels   :   0.35 ( 0%) usr   0.00 ( 0%) sys   0.35  
( 0%) wall       0 kB ( 0%) ggc
preprocessing         :   0.71 ( 0%) usr   1.05 ( 6%) sys   1.69  
( 0%) wall    2918 kB ( 0%) ggc
lexical analysis      :   0.54 ( 0%) usr   1.82 (11%) sys   2.39  
( 0%) wall       0 kB ( 0%) ggc
parser                :   1.34 ( 1%) usr   1.00 ( 6%) sys   2.37  
( 0%) wall   66046 kB ( 8%) ggc
inline heuristics     :   0.67 ( 0%) usr   0.16 ( 1%) sys   0.83  
( 0%) wall       0 kB ( 0%) ggc
tree gimplify         :   1.07 ( 0%) usr   0.04 ( 0%) sys   1.13  
( 0%) wall   62339 kB ( 8%) ggc
tree eh               :   0.11 ( 0%) usr   0.00 ( 0%) sys   0.11  
( 0%) wall       0 kB ( 0%) ggc
tree CFG construction :   0.51 ( 0%) usr   0.07 ( 0%) sys   0.57  
( 0%) wall   68526 kB ( 8%) ggc
tree CFG cleanup      :   7.11 ( 3%) usr   0.00 ( 0%) sys   7.16  
( 1%) wall    3524 kB ( 0%) ggc
tree copy propagation :   2.52 ( 1%) usr   0.06 ( 0%) sys   2.61  
( 1%) wall    5702 kB ( 1%) ggc
tree find ref. vars   :   0.15 ( 0%) usr   0.00 ( 0%) sys   0.15  
( 0%) wall    1819 kB ( 0%) ggc
tree PTA              :   1.96 ( 1%) usr   0.12 ( 1%) sys   2.08  
( 0%) wall    3734 kB ( 0%) ggc
tree alias analysis   :   0.06 ( 0%) usr   0.12 ( 1%) sys   0.19  
( 0%) wall       0 kB ( 0%) ggc
tree call clobbering  :   0.02 ( 0%) usr   0.00 ( 0%) sys   0.03  
( 0%) wall       0 kB ( 0%) ggc
tree flow sensitive alias:   0.17 ( 0%) usr   0.00 ( 0%) sys   0.16  
( 0%) wall    2146 kB ( 0%) ggc
tree memory partitioning:   1.30 ( 1%) usr   0.00 ( 0%) sys   1.30  
( 0%) wall       0 kB ( 0%) ggc
tree PHI insertion    :   0.64 ( 0%) usr   0.04 ( 0%) sys   0.69  
( 0%) wall   18541 kB ( 2%) ggc
tree SSA rewrite      :   1.93 ( 1%) usr   0.03 ( 0%) sys   1.95  
( 0%) wall   35021 kB ( 4%) ggc
tree SSA other        :   0.23 ( 0%) usr   0.09 ( 1%) sys   0.24  
( 0%) wall       0 kB ( 0%) ggc
tree SSA incremental  :   8.52 ( 3%) usr   0.08 ( 0%) sys   8.57  
( 2%) wall   14256 kB ( 2%) ggc
tree operand scan     :   0.73 ( 0%) usr   0.24 ( 1%) sys   0.97  
( 0%) wall   28110 kB ( 3%) ggc
dominator optimization:   2.75 ( 1%) usr   0.03 ( 0%) sys   2.80  
( 1%) wall   42635 kB ( 5%) ggc
tree STORE-CCP        :   0.59 ( 0%) usr   0.00 ( 0%) sys   0.59  
( 0%) wall    1024 kB ( 0%) ggc
tree CCP              :   1.20 ( 0%) usr   0.01 ( 0%) sys   1.21  
( 0%) wall    1537 kB ( 0%) ggc
tree PHI const/copy prop:   0.24 ( 0%) usr   0.00 ( 0%) sys   0.25  
( 0%) wall      11 kB ( 0%) ggc
tree split crit edges :   0.11 ( 0%) usr   0.03 ( 0%) sys   0.13  
( 0%) wall   33706 kB ( 4%) ggc
tree reassociation    :   0.63 ( 0%) usr   0.00 ( 0%) sys   0.64  
( 0%) wall       1 kB ( 0%) ggc
tree FRE              :   2.66 ( 1%) usr   0.05 ( 0%) sys   2.77  
( 1%) wall   49006 kB ( 6%) ggc
tree code sinking     :   0.49 ( 0%) usr   0.00 ( 0%) sys   0.48  
( 0%) wall       6 kB ( 0%) ggc
tree linearize phis   :   0.28 ( 0%) usr   0.00 ( 0%) sys   0.28  
( 0%) wall       0 kB ( 0%) ggc
tree forward propagate:   0.34 ( 0%) usr   0.00 ( 0%) sys   0.32  
( 0%) wall     426 kB ( 0%) ggc
tree conservative DCE :   1.60 ( 1%) usr   0.00 ( 0%) sys   1.62  
( 0%) wall       0 kB ( 0%) ggc
tree aggressive DCE   :   0.35 ( 0%) usr   0.00 ( 0%) sys   0.35  
( 0%) wall       0 kB ( 0%) ggc
tree DSE              :   0.35 ( 0%) usr   0.00 ( 0%) sys   0.36  
( 0%) wall       1 kB ( 0%) ggc
PHI merge             :   0.06 ( 0%) usr   0.00 ( 0%) sys   0.06  
( 0%) wall    7192 kB ( 1%) ggc
tree loop bounds      :   0.17 ( 0%) usr   0.00 ( 0%) sys   0.17  
( 0%) wall       2 kB ( 0%) ggc
loop invariant motion :   0.32 ( 0%) usr   0.00 ( 0%) sys   0.32  
( 0%) wall       0 kB ( 0%) ggc
tree canonical iv     :   0.03 ( 0%) usr   0.00 ( 0%) sys   0.03  
( 0%) wall       0 kB ( 0%) ggc
scev constant prop    :   0.63 ( 0%) usr   0.00 ( 0%) sys   0.64  
( 0%) wall   17787 kB ( 2%) ggc
complete unrolling    :   0.01 ( 0%) usr   0.00 ( 0%) sys   0.01  
( 0%) wall       0 kB ( 0%) ggc
tree loop init        :   3.07 ( 1%) usr   0.09 ( 1%) sys   3.21  
( 1%) wall   45438 kB ( 6%) ggc
tree loop fini        :   0.01 ( 0%) usr   0.00 ( 0%) sys   0.01  
( 0%) wall       0 kB ( 0%) ggc
tree copy headers     :   0.06 ( 0%) usr   0.00 ( 0%) sys   0.07  
( 0%) wall       0 kB ( 0%) ggc
tree SSA uncprop      :   0.24 ( 0%) usr   0.00 ( 0%) sys   0.26  
( 0%) wall       0 kB ( 0%) ggc
tree SSA to normal    :  11.15 ( 4%) usr   0.07 ( 0%) sys  11.26  
( 2%) wall   81126 kB (10%) ggc
tree rename SSA copies:   0.55 ( 0%) usr   0.01 ( 0%) sys   0.56  
( 0%) wall       0 kB ( 0%) ggc
dominance frontiers   :   0.44 ( 0%) usr   0.00 ( 0%) sys   0.48  
( 0%) wall       0 kB ( 0%) ggc
dominance computation :   2.49 ( 1%) usr   0.05 ( 0%) sys   2.52  
( 1%) wall       0 kB ( 0%) ggc
expand                :  14.26 ( 6%) usr   1.80 (10%) sys 144.06  
(29%) wall   92074 kB (11%) ggc
lower subreg          :   0.23 ( 0%) usr   0.00 ( 0%) sys   0.24  
( 0%) wall       0 kB ( 0%) ggc
jump                  :   0.05 ( 0%) usr   0.00 ( 0%) sys   0.05  
( 0%) wall       0 kB ( 0%) ggc
CSE                   :   0.77 ( 0%) usr   0.00 ( 0%) sys   0.78  
( 0%) wall    1426 kB ( 0%) ggc
dead code elimination :   0.50 ( 0%) usr   0.00 ( 0%) sys   0.52  
( 0%) wall       0 kB ( 0%) ggc
dead store elim1      :   0.43 ( 0%) usr   0.06 ( 0%) sys   0.49  
( 0%) wall    7944 kB ( 1%) ggc
dead store elim2      :   0.49 ( 0%) usr   0.01 ( 0%) sys   0.51  
( 0%) wall    8877 kB ( 1%) ggc
loop analysis         :   0.60 ( 0%) usr   0.01 ( 0%) sys   0.61  
( 0%) wall      70 kB ( 0%) ggc
branch prediction     :   0.95 ( 0%) usr   0.02 ( 0%) sys   0.98  
( 0%) wall    1541 kB ( 0%) ggc
combiner              :   2.65 ( 1%) usr   0.04 ( 0%) sys   2.70  
( 1%) wall   27893 kB ( 3%) ggc
if-conversion         :   1.55 ( 1%) usr   0.00 ( 0%) sys   1.55  
( 0%) wall     655 kB ( 0%) ggc
local alloc           :   4.01 ( 2%) usr   0.02 ( 0%) sys   4.05  
( 1%) wall    7074 kB ( 1%) ggc
global alloc          :  25.75 (10%) usr   0.36 ( 2%) sys  26.20  
( 5%) wall    5111 kB ( 1%) ggc
reload CSE regs       :   1.21 ( 0%) usr   0.01 ( 0%) sys   1.24  
( 0%) wall   12243 kB ( 1%) ggc
thread pro- & epilogue:   0.10 ( 0%) usr   0.00 ( 0%) sys   0.10  
( 0%) wall       4 kB ( 0%) ggc
if-conversion 2       :   0.39 ( 0%) usr   0.00 ( 0%) sys   0.36  
( 0%) wall      82 kB ( 0%) ggc
rename registers      :   0.62 ( 0%) usr   0.04 ( 0%) sys   0.65  
( 0%) wall      31 kB ( 0%) ggc
scheduling 2          :   2.69 ( 1%) usr   0.05 ( 0%) sys   2.77  
( 1%) wall       0 kB ( 0%) ggc
machine dep reorg     :   0.52 ( 0%) usr   0.00 ( 0%) sys   0.52  
( 0%) wall     149 kB ( 0%) ggc
reorder blocks        :   0.25 ( 0%) usr   0.01 ( 0%) sys   0.26  
( 0%) wall    6758 kB ( 1%) ggc
final                 :   1.26 ( 1%) usr   0.01 ( 0%) sys   1.27  
( 0%) wall       0 kB ( 0%) ggc
tree if-combine       :   0.06 ( 0%) usr   0.00 ( 0%) sys   0.06  
( 0%) wall     223 kB ( 0%) ggc
TOTAL                 : 249.32            17.19            
503.80             816827 kB

Program exited normally.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26854


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]