summaryrefslogtreecommitdiffhomepage
path: root/ir/be/bestack.c
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2014-10-07 15:45:55 +0200
committerMatthias Braun <matze@braunis.de>2014-10-07 15:54:34 +0200
commitb719d82d7dd040cd03fca522a86f12c52f2b8953 (patch)
tree6f72717867a27bab4f0393cfacd145cd4db9f94e /ir/be/bestack.c
parent14b3c4c7035bac15503d5c3d26bcf11dd65f757c (diff)
API change+fix for IncSP alignment
- alignment is set on each single IncSP now instead of a global arch_env setting - fixed ia32 not requesting any alignment anymore (even on darwin where we need it) - fixed amd64 creating IncSP nodes without flag_modifies_flags set
Diffstat (limited to 'ir/be/bestack.c')
-rw-r--r--ir/be/bestack.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/ir/be/bestack.c b/ir/be/bestack.c
index 39e6e49..bb9d746 100644
--- a/ir/be/bestack.c
+++ b/ir/be/bestack.c
@@ -107,12 +107,13 @@ static int process_stack_bias(ir_node *bl, int real_bias)
/* If the node modifies the stack pointer by a constant offset,
* record that in the bias. */
if (be_is_IncSP(irn)) {
- int ofs = be_get_IncSP_offset(irn);
+ int ofs = be_get_IncSP_offset(irn);
+ unsigned align = be_get_IncSP_align(irn);
/* fill in real stack frame size */
- if (be_get_IncSP_align(irn)) {
+ if (align > 0) {
/* patch IncSP to produce an aligned stack pointer */
int const between_size = get_type_size_bytes(layout->between_type);
- int const alignment = 1 << arch_env->stack_alignment;
+ int const alignment = 1 << align;
int const delta = (real_bias + ofs + between_size) & (alignment - 1);
assert(ofs >= 0);
if (delta > 0) {