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]

C++ optimization: compile time + memory consumption regression ongcc3.3 branch


Hello,

two months or so ago, I've noticed that one of MICO core file is not
compilable by gcc3.3 - i.e. I've thought that gcc goes into infinite loop
while compiling it. Today I'm trying to find where is the problem to fill
proper bugreport. I've found that gcc is not in infinite loop, but just
that it spend too long time in ``expand'' and consumes too much memory in
comparison with gcc3.2.2

Rought comparison:

gcc3.2.2: time 20s memory 58MB (reported by top)
gcc3.3:   time 900s memory about 250MB (reported by top)

I've tried -O2 optimization, but the same problem seems to be with -Os

I've added -fmem-report + -ftime-report below. Please note that memory
statistic doesn't seems to be accurate - i.e. total 70MB versus my 250MB
in top (gcc3.2.2 has total 42MB and in top 58MB).

What I would like to know is if it's already known bug, or if it's unknown
and so I should spend some time with trying to find problematic piece of
code...

Thanks,

Karel

thinkpad:~/arch/devel/gcc-bug/orb$ rm security/csiv2_impl.pic.o; c++
-ftime-report -fmem-report -I../include  -O2  -Wall -fpermissive   -DPIC
-fPIC  -c security/csiv2_impl.cc -o security/csiv2_impl.pic.o
rm: cannot remove `security/csiv2_impl.pic.o': No such file or directory

Tree                 Number            Bytes    % Total
Total                     0               0

RTX                  Number            Bytes    % Total
Total                     0               0

Size   Allocated        Used    Overhead
8            216k        164k       4968
16           412k        350k       6180
32          9296k       5581k         99k
64          4732k       2169k         41k
128         8192        5504          64
256          484k         69k       3388
512          228k        106k       1596
1024          72k         72k        504
2048          44k         42k        308
4096          88k         88k        616
8192        8192        8192          28
16384         16k         16k         28
131072        256k        256k         56
112           20M         19M        163k
20            30M       8894k        401k
12           148k         83k       2516
44          3596k       2485k         31k
Total         70M         39M        757k

String pool
entries         19538
identifiers     19538 (100.00%)
slots           32768
bytes           575k (28k overhead)
table size      128k
coll/search     0.4702
ins/search      0.0966
avg. entry      30.18 bytes (+/- 38.38)
longest entry   1052

??? tree nodes created

(No per-node statistics)
Type hash: size 32749, 18454 elements, 1.687557 collisions
no search statistics

Execution times (seconds)
 garbage collection    :   2.68 ( 0%) usr   0.02 ( 0%) sys   2.86 ( 0%) wall
 cfg construction      :   0.89 ( 0%) usr   0.07 ( 1%) sys   1.12 ( 0%) wall
 cfg cleanup           :  24.66 ( 3%) usr   0.27 ( 4%) sys  30.34 ( 3%) wall
 trivially dead code   :   0.65 ( 0%) usr   0.03 ( 0%) sys   0.83 ( 0%) wall
 life analysis         :   0.49 ( 0%) usr   0.07 ( 1%) sys   0.55 ( 0%) wall
 life info update      :   0.17 ( 0%) usr   0.03 ( 0%) sys   0.20 ( 0%) wall
 preprocessing         :   0.47 ( 0%) usr   0.14 ( 2%) sys   0.84 ( 0%) wall
 lexical analysis      :   0.38 ( 0%) usr   0.13 ( 2%) sys   0.58 ( 0%) wall
 parser                :  11.36 ( 1%) usr   0.44 ( 7%) sys  12.77 ( 1%) wall
 name lookup           :   2.72 ( 0%) usr   0.49 ( 8%) sys   3.20 ( 0%) wall
 expand                : 774.60 (92%) usr   0.63 (10%) sys 814.47 (89%) wall
 varconst              :   0.07 ( 0%) usr   0.01 ( 0%) sys   0.09 ( 0%) wall
 integration           :   0.11 ( 0%) usr   0.00 ( 0%) sys   0.09 ( 0%) wall
 jump                  :   5.96 ( 1%) usr   0.21 ( 3%) sys   7.38 ( 1%) wall
 CSE                   :   1.26 ( 0%) usr   0.11 ( 2%) sys   9.22 ( 1%) wall
 global CSE            :   2.26 ( 0%) usr   0.79 (12%) sys   7.92 ( 1%) wall
 loop analysis         :   4.41 ( 1%) usr   2.38 (37%) sys   8.34 ( 1%) wall
 CSE 2                 :   0.44 ( 0%) usr   0.01 ( 0%) sys   1.34 ( 0%) wall
 branch prediction     :   0.45 ( 0%) usr   0.01 ( 0%) sys   0.67 ( 0%) wall
 flow analysis         :   0.20 ( 0%) usr   0.02 ( 0%) sys   0.39 ( 0%) wall
 combiner              :   0.40 ( 0%) usr   0.05 ( 1%) sys   0.72 ( 0%) wall
 if-conversion         :   0.15 ( 0%) usr   0.00 ( 0%) sys   0.17 ( 0%) wall
 regmove               :   0.80 ( 0%) usr   0.02 ( 0%) sys   1.25 ( 0%) wall
 mode switching        :   0.10 ( 0%) usr   0.00 ( 0%) sys   0.19 ( 0%) wall
 local alloc           :   0.67 ( 0%) usr   0.12 ( 2%) sys   1.14 ( 0%) wall
 global alloc          :   1.35 ( 0%) usr   0.03 ( 0%) sys   2.58 ( 0%) wall
 reload CSE regs       :   0.87 ( 0%) usr   0.02 ( 0%) sys   1.03 ( 0%) wall
 flow 2                :   0.16 ( 0%) usr   0.02 ( 0%) sys   0.23 ( 0%) wall
 if-conversion 2       :   0.02 ( 0%) usr   0.00 ( 0%) sys   0.03 ( 0%) wall
 peephole 2            :   0.03 ( 0%) usr   0.00 ( 0%) sys   0.08 ( 0%) wall
 rename registers      :   0.11 ( 0%) usr   0.01 ( 0%) sys   0.12 ( 0%) wall
 scheduling 2          :   0.35 ( 0%) usr   0.03 ( 0%) sys   0.38 ( 0%) wall
 reorder blocks        :   0.02 ( 0%) usr   0.00 ( 0%) sys   0.02 ( 0%) wall
 shorten branches      :   0.10 ( 0%) usr   0.00 ( 0%) sys   0.09 ( 0%) wall
 final                 :   0.14 ( 0%) usr   0.00 ( 0%) sys   0.22 ( 0%) wall
 rest of compilation   :   1.27 ( 0%) usr   0.04 ( 1%) sys   1.67 ( 0%) wall
 TOTAL                 : 840.82             6.37           913.42

thinkpad:~/arch/devel/gcc-bug/orb$ c++ -v
Reading specs from
/home/karel/usr/local/gcc3.3.x/lib/gcc-lib/i686-pc-linux-gnu/3.3/specs
Configured with: /home/karel/cvs/gcc/gcc-3_3-branch/configure
--prefix=/home/karel/usr/local/gcc3.3.x --enable-shared --enable-threads
--enable-languages=c++ --disable-checking --enable-__cxa_atexit
Thread model: posix
gcc version 3.3 20030222 (prerelease)
You have mail in /var/mail/karel
thinkpad:~/arch/devel/gcc-bug/orb$

--
Karel Gardas                  kgardas at objectsecurity dot com
ObjectSecurity Ltd.           http://www.objectsecurity.com


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