diff options
Diffstat (limited to 'gcc/explow.c')
-rw-r--r-- | gcc/explow.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/explow.c b/gcc/explow.c index 5eec1d7..0f067ca 100644 --- a/gcc/explow.c +++ b/gcc/explow.c @@ -852,6 +852,11 @@ adjust_stack (adjust) if (adjust == const0_rtx) return; + /* We expect all variable sized adjustments to be multiple of + PREFERRED_STACK_BOUNDARY. */ + if (GET_CODE (adjust) == CONST_INT) + stack_pointer_delta -= INTVAL (adjust); + temp = expand_binop (Pmode, #ifdef STACK_GROWS_DOWNWARD add_optab, @@ -878,6 +883,11 @@ anti_adjust_stack (adjust) if (adjust == const0_rtx) return; + /* We expect all variable sized adjustments to be multiple of + PREFERRED_STACK_BOUNDARY. */ + if (GET_CODE (adjust) == CONST_INT) + stack_pointer_delta += INTVAL (adjust); + temp = expand_binop (Pmode, #ifdef STACK_GROWS_DOWNWARD sub_optab, @@ -1295,6 +1305,13 @@ allocate_dynamic_stack_space (size, target, known_align) do_pending_stack_adjust (); + /* We ought to be called always on the toplevel and stack ought to be aligned + propertly. */ +#ifdef PREFERRED_STACK_BOUNDARY + if (stack_pointer_delta % (PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT)) + abort (); +#endif + /* If needed, check that we have the required amount of stack. Take into account what has already been checked. */ if (flag_stack_check && ! STACK_CHECK_BUILTIN) |