summaryrefslogtreecommitdiff
path: root/gcc/explow.c
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2011-01-18 21:29:11 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2011-01-18 21:29:11 +0000
commit156512c1e4081eeff3ff8ba147237a4e7fa24336 (patch)
tree8cc1b63baa2f41820df5c80ec6e17cbd79ac56dd /gcc/explow.c
parent329c1e4ecc2154f2411625dcbf449679b4241534 (diff)
downloadgcc-156512c1e4081eeff3ff8ba147237a4e7fa24336.tar.gz
PR middle-end/46894
* explow.c (allocate_dynamic_stack_space): Do not assume more than BITS_PER_UNIT alignment if STACK_DYNAMIC_OFFSET or STACK_POINTER_OFFSET are defined. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@168968 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/explow.c')
-rw-r--r--gcc/explow.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/gcc/explow.c b/gcc/explow.c
index 836f244b3a1..2a182065bca 100644
--- a/gcc/explow.c
+++ b/gcc/explow.c
@@ -1148,6 +1148,7 @@ allocate_dynamic_stack_space (rtx size, unsigned size_align,
{
HOST_WIDE_INT stack_usage_size = -1;
rtx final_label, final_target, target;
+ unsigned extra_align = 0;
bool must_align;
/* If we're asking for zero bytes, it doesn't matter what we point
@@ -1231,21 +1232,25 @@ allocate_dynamic_stack_space (rtx size, unsigned size_align,
that might result from the alignment operation. */
must_align = (crtl->preferred_stack_boundary < required_align);
-#if defined (STACK_DYNAMIC_OFFSET) || defined (STACK_POINTER_OFFSET)
- must_align = true;
-#endif
-
if (must_align)
{
- unsigned extra, extra_align;
-
if (required_align > PREFERRED_STACK_BOUNDARY)
extra_align = PREFERRED_STACK_BOUNDARY;
else if (required_align > STACK_BOUNDARY)
extra_align = STACK_BOUNDARY;
else
extra_align = BITS_PER_UNIT;
- extra = (required_align - extra_align) / BITS_PER_UNIT;
+ }
+
+ /* ??? STACK_POINTER_OFFSET is always defined now. */
+#if defined (STACK_DYNAMIC_OFFSET) || defined (STACK_POINTER_OFFSET)
+ must_align = true;
+ extra_align = BITS_PER_UNIT;
+#endif
+
+ if (must_align)
+ {
+ unsigned extra = (required_align - extra_align) / BITS_PER_UNIT;
size = plus_constant (size, extra);
size = force_operand (size, NULL_RTX);