aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/sh
diff options
context:
space:
mode:
authorJoern Rennecke <amylaar@gcc.gnu.org>1997-04-09 18:50:38 +0100
committerJoern Rennecke <amylaar@gcc.gnu.org>1997-04-09 18:50:38 +0100
commit20ec31d3056be8424863e84d4261d5d5d7945cc7 (patch)
treecd4a5543949ad7ddd6cdfa98b67b5bf6215814cf /gcc/config/sh
parent74452ac3234316852e4f63d48f62db44991649b2 (diff)
downloadgcc-20ec31d3056be8424863e84d4261d5d5d7945cc7.zip
gcc-20ec31d3056be8424863e84d4261d5d5d7945cc7.tar.gz
gcc-20ec31d3056be8424863e84d4261d5d5d7945cc7.tar.bz2
(output_stack_adjust): When splitting an adjustment into two parts,
make sure the stack is aligned at all times. From-SVN: r13846
Diffstat (limited to 'gcc/config/sh')
-rw-r--r--gcc/config/sh/sh.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index 0f3a94f..12a49ca 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -2490,11 +2490,15 @@ output_stack_adjust (size, reg, temp)
if (! CONST_OK_FOR_I (size))
{
- if (CONST_OK_FOR_I (size / 2) && CONST_OK_FOR_I (size - size / 2))
+ /* Try to do it with two partial adjustments; however, must make
+ sure that the stack is properly aligned at all times, in case
+ an interrupt occurs between the two partial adjustments. */
+ if (CONST_OK_FOR_I (size / 2 & -4)
+ && CONST_OK_FOR_I (size - (size / 2 & -4)))
{
- val = GEN_INT (size / 2);
+ val = GEN_INT (size / 2 & -4);
emit_insn (gen_addsi3 (reg, reg, val));
- val = GEN_INT (size - size / 2);
+ val = GEN_INT (size - (size / 2 & -4));
}
else
{