summaryrefslogtreecommitdiff
path: root/gcc/explow.c
diff options
context:
space:
mode:
authorDominik Vogt <vogt@linux.vnet.ibm.com>2016-11-18 14:44:54 +0000
committerAndreas Krebbel <krebbel@gcc.gnu.org>2016-11-18 14:44:54 +0000
commitd79318594936bb80dc5a0b82c70346249c49e5b0 (patch)
treebd8a56796bce7c461774d60a3022c45d1aeb7b69 /gcc/explow.c
parenta7790c7174a016fcea0af852a493479f0dadfdf3 (diff)
downloadgcc-d79318594936bb80dc5a0b82c70346249c49e5b0.tar.gz
Re-apply: Drop excess size used for run time allocated stack variables.
The patch got reverted after hitting PR77359 which turned out to be a rs6000 backend problem. Reapplying after the PR got fixed. gcc/ChangeLog: 2016-11-18 Dominik Vogt <vogt@linux.vnet.ibm.com> Re-apply after PR bootstrap/77359 is fixed: 2016-08-23 Dominik Vogt <vogt@linux.vnet.ibm.com> * explow.c (get_dynamic_stack_size): Take known alignment of stack pointer + STACK_DYNAMIC_OFFSET into account when calculating the size needed. --This line, and those below, will be ignored-- M gcc/ChangeLog M gcc/explow.c From-SVN: r242590
Diffstat (limited to 'gcc/explow.c')
-rw-r--r--gcc/explow.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/gcc/explow.c b/gcc/explow.c
index 75af333c1c3..6758cca87e7 100644
--- a/gcc/explow.c
+++ b/gcc/explow.c
@@ -1233,9 +1233,15 @@ get_dynamic_stack_size (rtx *psize, unsigned size_align,
example), so we must preventively align the value. We leave space
in SIZE for the hole that might result from the alignment operation. */
- extra = (required_align - BITS_PER_UNIT) / BITS_PER_UNIT;
- size = plus_constant (Pmode, size, extra);
- size = force_operand (size, NULL_RTX);
+ unsigned known_align = REGNO_POINTER_ALIGN (VIRTUAL_STACK_DYNAMIC_REGNUM);
+ if (known_align == 0)
+ known_align = BITS_PER_UNIT;
+ if (required_align > known_align)
+ {
+ extra = (required_align - known_align) / BITS_PER_UNIT;
+ size = plus_constant (Pmode, size, extra);
+ size = force_operand (size, NULL_RTX);
+ }
if (flag_stack_usage_info && pstack_usage_size)
*pstack_usage_size += extra;