summaryrefslogtreecommitdiffhomepage
path: root/ir/be/bestack.c
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2011-03-07 14:46:34 +0100
committerMatthias Braun <matze@braunis.de>2011-03-16 19:33:23 +0100
commitbb523cb9ad91bcdc9af9e8e23093b637f3cba096 (patch)
treea29b2c686943fd308b65e4081fe7e6fbb77de101 /ir/be/bestack.c
parent23df3482d67145fdf239dc40d422b7fe1e630bd2 (diff)
bestack: add support for nodes resetting the stack
Diffstat (limited to 'ir/be/bestack.c')
-rw-r--r--ir/be/bestack.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/ir/be/bestack.c b/ir/be/bestack.c
index 320c5c8..18522b1 100644
--- a/ir/be/bestack.c
+++ b/ir/be/bestack.c
@@ -183,9 +183,8 @@ 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.
*/
- ofs = arch_get_sp_bias(irn);
-
if (be_is_IncSP(irn)) {
+ ofs = be_get_IncSP_offset(irn);
/* fill in real stack frame size */
if (ofs == BE_STACK_FRAME_SIZE_EXPAND) {
ir_type *frame_type = get_irg_frame_type(irg);
@@ -217,10 +216,18 @@ static int process_stack_bias(ir_node *bl, int real_bias)
}
}
}
+ real_bias += ofs;
+ wanted_bias += ofs;
+ } else {
+ ofs = arch_get_sp_bias(irn);
+ if (ofs == SP_BIAS_RESET) {
+ real_bias = 0;
+ wanted_bias = 0;
+ } else {
+ real_bias += ofs;
+ wanted_bias += ofs;
+ }
}
-
- real_bias += ofs;
- wanted_bias += ofs;
}
assert(real_bias == wanted_bias);