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]

Re: Performance problem on native/cross ppc-aix4, exposed by RTL check


 > From: "Kaveh R. Ghazi" <ghazi@caip.rutgers.edu>
 > 
 > I'm encountering a severe gcc compiler performance problem exposed by
 > trying to bootstrap powerpc-ibm-aix4.1.4.0 with RTL checking.  In
 > stage2 when compiling insn-extract.c, after about 1.5 hours I get:
 > 
 >  > Cannot allocate 27100788 bytes after allocating 4138464796 bytes
 >  > make[2]: *** [insn-extract.o] Error 1
 > 
 > Without RTL checking it compiles almost immediately.  Note stage1 was
 > compiled with cc which turns off RTL checking for that stage.  Thus
 > the performance problems are not due to the extra overhead of RTL
 > check *processing*.  Its due to the extra code that gets inserted into
 > the stage2 insn-extract.c which must be compiled.  Even so, its very
 > excessive and IMHO a case where gcc exhibits pathological behavior.
 > 
 > I was able to expose lengthy compilation times using a cross
 > configuration on i686-pc-linux-gnu -> powerpc-ibm-aix4.1.4.0 as well.
 > (Though you'll have to comment out -lld in the Makefile, you'll see
 > what I mean if you try to build the cross configuration.)
 > 
 > Using the cross compiler, I simply compiled insn-extract.i from the
 > original native try.  The strange thing is that even with no
 > optimizations, I get the performance problem.  After ~20 minutes at
 > -O0, the compilation finished.
 > 
 > During the compile, I noticed that cc1 used at least 80Mb of memory.
 > I attached gdb to the running cc1 in the cross attempt soon after it
 > started, here's what I got:
 > 
 >  > (gdb) where
 >  > #0  0x81cc851 in record_reg_classes (n_alts=12, n_ops=2, ops=0x83aebe0, 
 >  >     modes=0xbffff0a4, constraints=0xbffff0cc, insn=0x406f1040, 
 >  >     op_costs=0xbffff160, reg_pref=0x0)
 >  >     at ../../egcs-CVS20000718/gcc/regclass.c:1698
 >  > #1  0x81c9a9e in record_operand_costs (insn=0x406f1040, op_costs=0xbffff160, 
 >  >     reg_pref=0x0) at ../../egcs-CVS20000718/gcc/regclass.c:904
 >  > #2  0x81ca156 in scan_one_insn (insn=0x406f1040, pass=0)
 >  >     at ../../egcs-CVS20000718/gcc/regclass.c:1014
 >  > #3  0x81ca62a in regclass (f=0x402d71e0, nregs=70403, dump=0x0)
 >  >     at ../../egcs-CVS20000718/gcc/regclass.c:1136
 >  > #4  0x804e743 in rest_of_compilation (decl=0x402be880)
 >  >     at ../../egcs-CVS20000718/gcc/toplev.c:3316
 >  > #5  0x83020a8 in finish_function (nested=0)
 >  >     at ../../egcs-CVS20000718/gcc/c-decl.c:6605
 >  > #6  0x82e0be7 in yyparse () at c-parse.y:310
 >  > #7  0x804cd01 in compile_file (name=0x40121120 ">")
 >  >     at ../../egcs-CVS20000718/gcc/toplev.c:2293
 >  > #8  0x8051aa4 in main (argc=6, argv=0xbffffb04)
 >  >     at ../../egcs-CVS20000718/gcc/toplev.c:4736
 >  > (gdb) p lineno
 >  > $1 = 1432
 > 
 > Line 1432 is the last line of the file, also the last line of
 > insn_extract().
 > 
 > I've included the insn-extract.i from the native
 > powerpc-ibm-aix4.1.4.0 bootstrap in case anyone wants to investigate.
 > 
 > Just build a cross compiler to powerpc-ibm-aix4.1.4.0 and compile the
 > following .i file with -S.
 > 
 > 		--Kaveh




Another data point.  According to gprof, the 20 minute cross compile
spent 90% of its time in verify_flow_info.  This function was only
called 3 times.

 > Flat profile:
 >  
 > Each sample counts as 0.01 seconds.
 >   %   cumulative   self              self     total
 >  time   seconds   seconds    calls  ms/call  ms/call  name
 >  89.88    537.75   537.75        3 179250.00 179294.13  verify_flow_info
--
Kaveh R. Ghazi			Engagement Manager / Project Services
ghazi@caip.rutgers.edu		Qwest Internet Solutions

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