From: Easwaran Raman Date: Wed, 9 Oct 2013 21:07:54 +0000 (+0000) Subject: params.def (PARAM_MIN_SIZE_FOR_STACK_SHARING): New param... X-Git-Tag: releases/gcc-4.9.0~3651 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4d5b5e9f2c37500cb85e18ce685be3bdd6ba549d;p=thirdparty%2Fgcc.git params.def (PARAM_MIN_SIZE_FOR_STACK_SHARING): New param... 2013-10-09 Easwaran Raman * params.def (PARAM_MIN_SIZE_FOR_STACK_SHARING): New param... * cfgexpand.c (defer_stack_allocation): ...use here * doc/invoke.texi: Add documentation for min-size-for-stack-sharing. From-SVN: r203330 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b1028bf7167a..5f7b962d978a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2013-10-09 Easwaran Raman + + * params.def (PARAM_MIN_SIZE_FOR_STACK_SHARING): New param... + * cfgexpand.c (defer_stack_allocation): ...use here + * doc/invoke.texi: Add documentation for min-size-for-stack-sharing. + 2013-10-09 Zhenqiang Chen * tree-ssa-phiopts.c (rhs_is_fed_for_value_replacement): New function. diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c index afb02a0801b9..7ed29f5c2273 100644 --- a/gcc/cfgexpand.c +++ b/gcc/cfgexpand.c @@ -1131,7 +1131,9 @@ defer_stack_allocation (tree var, bool toplevel) other hand, we don't want the function's stack frame size to get completely out of hand. So we avoid adding scalars and "small" aggregates to the list at all. */ - if (optimize == 0 && tree_low_cst (DECL_SIZE_UNIT (var), 1) < 32) + if (optimize == 0 + && (tree_low_cst (DECL_SIZE_UNIT (var), 1) + < PARAM_VALUE (PARAM_MIN_SIZE_FOR_STACK_SHARING))) return false; return true; diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 0f32c24f15fd..a8d6dfa5459d 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -9686,6 +9686,10 @@ value of a shared integer constant. The default value is 256. The minimum size of buffers (i.e.@: arrays) that receive stack smashing protection when @option{-fstack-protection} is used. +@item min-size-for-stack-sharing +The minimum size of variables taking part in stack slot sharing when not +optimizing. The default value is 32. + @item max-jump-thread-duplication-stmts Maximum number of statements allowed in a block that needs to be duplicated when threading jumps. diff --git a/gcc/params.def b/gcc/params.def index ff9ba9a8abcc..def5a9a5eaa7 100644 --- a/gcc/params.def +++ b/gcc/params.def @@ -682,6 +682,12 @@ DEFPARAM (PARAM_SSP_BUFFER_SIZE, "The lower bound for a buffer to be considered for stack smashing protection", 8, 1, 0) +DEFPARAM (PARAM_MIN_SIZE_FOR_STACK_SHARING, + "min-size-for-stack-sharing", + "The minimum size of variables taking part in stack slot sharing " + "when not optimizing", + 32, 0, 0) + /* When we thread through a block we have to make copies of the statements within the block. Clearly for large blocks the code duplication is bad.