aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEaswaran Raman <eraman@google.com>2013-10-09 21:07:54 +0000
committerEaswaran Raman <eraman@gcc.gnu.org>2013-10-09 21:07:54 +0000
commit4d5b5e9f2c37500cb85e18ce685be3bdd6ba549d (patch)
treead4a66df6d3b6cda0eaca95d0828d6b2e9c64305
parentc9ef86a1717dd66f185aff6578cf4744771b39e4 (diff)
downloadgcc-4d5b5e9f2c37500cb85e18ce685be3bdd6ba549d.zip
gcc-4d5b5e9f2c37500cb85e18ce685be3bdd6ba549d.tar.gz
gcc-4d5b5e9f2c37500cb85e18ce685be3bdd6ba549d.tar.bz2
params.def (PARAM_MIN_SIZE_FOR_STACK_SHARING): New param...
2013-10-09 Easwaran Raman <eraman@google.com> * 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
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/cfgexpand.c4
-rw-r--r--gcc/doc/invoke.texi4
-rw-r--r--gcc/params.def6
4 files changed, 19 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b1028bf..5f7b962 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2013-10-09 Easwaran Raman <eraman@google.com>
+
+ * 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 <zhenqiang.chen@arm.com>
* tree-ssa-phiopts.c (rhs_is_fed_for_value_replacement): New function.
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index afb02a0..7ed29f5 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 0f32c24..a8d6dfa 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 ff9ba9a..def5a9a 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.