the 4.3.1 release introduces a new time/memory hog which wasn't present in 4.3.0-20080417. results (with default max-fields-for-field-sensitive param): 4.3.0-20080417 : mem: 580MB, time: 1min32sec. 4.3.1 : aborted at 4.3GB/14min.
Created attachment 15749 [details] testcase
testcase tested with: $ i486-gnu-linux-g++ -g0 -O2 -std=gnu++0x -fno-threadsafe-statics -fPIC hescoreScr.ii -c gdb report still the same backtrace: (gdb) bt #0 0x000000000066891b in set_bb_for_stmt () #1 0x000000000069c4cb in create_phi_node () #2 0x000000000068d066 in insert_phi_nodes_for () #3 0x000000000068d3e8 in insert_updated_phi_nodes_for () #4 0x000000000068e59c in update_ssa () #5 0x00000000006bd21a in compute_may_aliases () #6 0x00000000005f2c8a in execute_function_todo () #7 0x00000000005f274d in execute_todo () #8 0x00000000005f294a in execute_one_pass () #9 0x00000000005f2a9c in execute_pass_list () #10 0x00000000005f2aae in execute_pass_list () #11 0x0000000000695892 in tree_rest_of_compilation () #12 0x0000000000792902 in cgraph_expand_function () #13 0x000000000079404e in cgraph_optimize () #14 0x00000000004482ef in cp_write_global_declarations () #15 0x000000000066362e in toplev_main () #16 0x00002b69a416c4a4 in __libc_start_main () from /lib64/libc.so.6 #17 0x00000000004023a9 in _start ()
Eventually the fix for PR36154 may be the cause. Can you check backing out 2008-05-08 Richard Guenther <rguenther@suse.de> PR middle-end/36154 * tree-ssa-structalias.c (push_fields_onto_fieldstack): Make sure to create a representative for trailing arrays for PTA. ? Or the fix for PR36339, which would be 2008-05-28 Richard Guenther <rguenther@suse.de> PR tree-optimization/36339 * tree-ssa-alias.c (set_initial_properties): Move pt_anything and subvariable clobbering code out of the loop. 2008-05-27 Richard Guenther <rguenther@suse.de> PR tree-optimization/36339 * tree-ssa-alias.c (set_initial_properties): Escaped pt_anything pointers cause all addressable variables to be call clobbered.
Created attachment 15750 [details] unincluded testcase
The offending function is virtual bool hcScr::hescoreScr::init(Tcl_Interp*, hc::IAccessBase*, vcm::vcmptr<cfgmgr::IConfigManager>) but probably only after inlining. The trunk is fine, as is compiling with --param max-fields-for-field-sensitive=0. Most of the time/memory is spent in update_ssa () in phi-insertion.
this patch causes regression. ------------------------------------------------------------------------ r135125 | rguenth | 2008-05-09 21:19:33 +0200 (Fri, 09 May 2008) | 10 lines 2008-05-09 Richard Guenther <rguenther@suse.de> PR tree-optimization/36187 * tree-dfa.c (dump_variable): Correct dumping of SFT_BASE_FOR_COMPONENTS_P. * tree-ssa-structalias.c (set_uids_in_ptset): Set SFT_UNPARTITIONABLE_P correctly for the union case.
Then the following should fix it. Index: tree-flow-inline.h =================================================================== --- tree-flow-inline.h (revision 135770) +++ tree-flow-inline.h (working copy) @@ -1712,6 +1712,11 @@ var_can_have_subvars (const_tree v) if (!DECL_P (v) || MTAG_P (v)) return false; + /* Unions cannot have subvars. */ + if (TREE_CODE (TREE_TYPE (v)) == UNION_TYPE + || TREE_CODE (TREE_TYPE (v)) == QUAL_UNION_TYPE) + return false; + /* Aggregates can have subvars. */ if (AGGREGATE_TYPE_P (TREE_TYPE (v))) return true;
(In reply to comment #7) > Then the following should fix it. > > Index: tree-flow-inline.h > =================================================================== > --- tree-flow-inline.h (revision 135770) > +++ tree-flow-inline.h (working copy) > @@ -1712,6 +1712,11 @@ var_can_have_subvars (const_tree v) > if (!DECL_P (v) || MTAG_P (v)) > return false; > > + /* Unions cannot have subvars. */ > + if (TREE_CODE (TREE_TYPE (v)) == UNION_TYPE > + || TREE_CODE (TREE_TYPE (v)) == QUAL_UNION_TYPE) > + return false; > + > /* Aggregates can have subvars. */ > if (AGGREGATE_TYPE_P (TREE_TYPE (v))) > return true; > with this change g++ needs ~1GB and ~4minutes.
Hm, the patch in comment #6 only affects the case where we have a union with subvars. Did you check that just reverting this patch brings us back to 580MB and 1min32?
(In reply to comment #9) > Hm, the patch in comment #6 only affects the case where we have a union with > subvars. Did you check that just reverting this patch brings us back to > 580MB and 1min32? yes, i've checked r135124 and it needs only ~580MB.
Ah, but that test also reverts all followup patches, like 2008-05-28 Richard Guenther <rguenther@suse.de> PR tree-optimization/36339 * tree-ssa-alias.c (set_initial_properties): Move pt_anything and subvariable clobbering code out of the loop. 2008-05-27 Richard Guenther <rguenther@suse.de> PR tree-optimization/36339 * tree-ssa-alias.c (set_initial_properties): Escaped pt_anything pointers cause all addressable variables to be call clobbered. so, did you apply the patch in comment #7 on top of r135125 or on top of the branch head?
(In reply to comment #11) > Ah, but that test also reverts all followup patches, like > (...) > so, did you apply the patch in comment #7 on top of r135125 or on top > of the branch head? on top of the branch head (r136662). summary: r135124 needs max. 580MB(the 'virt' column from htop)/~1.5min r135125 and newer needs at least 4.3GB/14min. r136662 with suggested patch needs ~1GB/4min.
Subject: Bug 36498 Author: rguenth Date: Fri Jun 13 08:41:45 2008 New Revision: 136744 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=136744 Log: 2008-06-13 Richard Guenther <rguenther@suse.de> PR tree-optimization/36498 * tree-flow-inline.h (var_can_have_subvars): Unions cannot have subvars. Modified: branches/gcc-4_3-branch/gcc/ChangeLog branches/gcc-4_3-branch/gcc/tree-flow-inline.h
Richard -- Is this still an issue, after your patch? Thanks, -- Mark
Subject: Re: [4.3 Regression] time/memory hog for large c++ source. On Fri, 13 Jun 2008, mmitchel at gcc dot gnu dot org wrote: > Richard -- > > Is this still an issue, after your patch? It's still 4 times slower and uses twice as much memory. It will be fixed with the partitioning patch I posted yesterday. Richard.
Fixed.