summaryrefslogtreecommitdiffhomepage
path: root/ir/be/bespillslots.c
diff options
context:
space:
mode:
authorChristoph Mallon <christoph.mallon@gmx.de>2018-04-03 10:33:02 +0200
committerChristoph Mallon <christoph.mallon@gmx.de>2018-04-03 10:53:52 +0200
commitced77d384cb1bbedc1c57d345328e79e05a41de0 (patch)
tree31bf68ee3d3c7dc34f55e85c9c2a54bbd596a382 /ir/be/bespillslots.c
parent75a92e30b49a1394047a0db03e8bf614440db38a (diff)
amd64, be, ia32, sparc: Record that there is a twice returning call (setjmp) centrally in the birg.
This way not each backend has to keep a separate flag and also does not need to manually call be_forbid_coalescing().
Diffstat (limited to 'ir/be/bespillslots.c')
-rw-r--r--ir/be/bespillslots.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/ir/be/bespillslots.c b/ir/be/bespillslots.c
index aaf94c9..f4d664f 100644
--- a/ir/be/bespillslots.c
+++ b/ir/be/bespillslots.c
@@ -68,7 +68,6 @@ struct be_fec_env_t {
set_frame_entity_func set_frame_entity;
bool at_begin; /**< frame entities should be allocate at
the beginning of the stackframe */
- bool coalescing_forbidden;
};
/** Compare 2 affinity edges (used in quicksort) */
@@ -581,11 +580,6 @@ void be_free_frame_entity_coalescer(be_fec_env_t *env)
free(env);
}
-void be_forbid_coalescing(be_fec_env_t *env)
-{
- env->coalescing_forbidden = true;
-}
-
void be_assign_entities(be_fec_env_t *env,
set_frame_entity_func set_frame_entity,
bool alloc_entities_at_begin)
@@ -596,7 +590,10 @@ void be_assign_entities(be_fec_env_t *env,
if (stat_ev_enabled)
stat_ev_dbl("spillslots", ARR_LEN(env->spills));
- if (be_coalesce_spill_slots && !env->coalescing_forbidden)
+ /* Disable coalescing for "returns twice" calls: In case of setjmp/longjmp
+ * our control flow graph isn't completely correct: There are no backedges
+ * from longjmp to the setjmp => coalescing would produce wrong results. */
+ if (be_coalesce_spill_slots && !be_birg_from_irg(env->irg)->has_returns_twice_call)
do_greedy_coalescing(env);
if (stat_ev_enabled)