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

Re: [RFA] Limit stack usage growth caused by inliner


> On Sun, Nov 05, 2006 at 10:27:25PM +0100, Jan Hubicka wrote:
> > 	* invoke.texi (large-stack-frame, large-stack-frame-growth): New params.
> > 	* cgraph.c (dump_cgraph_node): Dump stack usage.
> > 	* cgraph.h (cgraph_local_info): Add estimated_self_stack_size.
> > 	(cgraph_global_info): Add estimated_stack_size and stack_frame_offset.
> > 	* cgraphunit.c (cgraph_analyze_function): Analyze stack sizes.
> > 	* ipa-inline.c (cgraph_clone_inlined_nodes): Propagate stack usage.
> > 	(cgraph_check_inline_limits): Limit stack growth.
> > 	* cfgexpand.c: Include tree-inline.h.
> > 	(account_stack_vars): New function.
> > 	(expand_one_var): New param to just account the stack; return estimated
> > 	size.
> > 	(expand_used_vars_for_block): Update call of expand_one_var.
> > 	(account_used_vars_for_block): New function.
> > 	(estimated_stack_frame_size): Likewise.
> > 	(init_vars_expansion, fini_vars_expansion): Break out from..
> > 	(expand_used_vars): ... here.
> > 	* tree-inline.h (estimated_stack_frame_size): Declare.
> > 	* params.def (PARAM_LARGE_STACK_FRAME, PARAM_STACK_FRAME_GROWTH): New.
> 
> FYI, this patch causes a bunch of regressions on the trunk, x86_64-linux:
> FAIL: libgomp.c++/nested-1.C  -O0  execution test
> FAIL: libgomp.c++/nested-1.C  -O1  execution test
> FAIL: libgomp.c++/pr27337.C  -O1  execution test
> FAIL: libgomp.fortran/character1.f90  -O0  execution test
> FAIL: libgomp.fortran/omp_parse4.f90  -O1  execution test
> FAIL: libgomp.fortran/reference1.f90  -O0  execution test
> FAIL: libgomp.fortran/reference2.f90  -O0  execution test
> 
> Reverting the {cgraph{,unit},ipa-inline,cfgexpand}.c changes cures all of
> these.

Hi,
I am testing the attached patch that cure at least the problems.  I will
commit it as obvious if testing passes and I do apologize for ignoring
the fails (those are ineed different from the testcase failures I see
appearing and disappearing, I just didn't expected possible bug to show
only in libgomp context and declared it SEP).

The random noise I see in reports looks like this:
Tests that now fail, but worked before:

libgomp.c++/pr27337.C -O0 execution test 
libgomp.c++/pr27337.C -O1 execution test

and such.  Perhaps the timeouts are just too small?

Honza

	* cfgexpand.c (expand_one_var): Guard expand_one_stack_var by really_expand.
Index: cfgexpand.c
===================================================================
--- cfgexpand.c	(revision 119518)
+++ cfgexpand.c	(working copy)
@@ -787,7 +787,8 @@ expand_one_var (tree var, bool toplevel,
     add_stack_var (var);
   else
     {
-      expand_one_stack_var (var);
+      if (really_expand)
+        expand_one_stack_var (var);
       return tree_low_cst (DECL_SIZE_UNIT (var), 1);
     }
   return 0;


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