summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJonas Haag <jonas@lophus.org>2015-12-18 16:24:48 +0100
committerPhilipp Serrer <philipp@serrer.de>2018-01-18 17:53:16 +0100
commit3f3d81614977d3372459a462bfc0427dc63d9b0c (patch)
tree949b80fdd22f2fb069249803e35e391a4d827d16
parent3047772906fabeeb86af9ecb98b0265857682e81 (diff)
Fix graph properties in funccall optimization
-rw-r--r--ir/opt/funccall.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/ir/opt/funccall.c b/ir/opt/funccall.c
index 7e1ad59..9398605 100644
--- a/ir/opt/funccall.c
+++ b/ir/opt/funccall.c
@@ -135,6 +135,7 @@ static void fix_const_call_lists(ir_graph *irg, ir_node **pure_call_list)
case pn_Call_X_except:
exc_changed = true;
+ ir_set_throws_exception(call, false);
exchange(proj, new_r_Bad(irg, mode_X));
break;
@@ -159,7 +160,8 @@ static void fix_const_call_lists(ir_graph *irg, ir_node **pure_call_list)
if (exc_changed) {
/* ... including exception edges */
clear_irg_properties(irg, IR_GRAPH_PROPERTY_CONSISTENT_DOMINANCE
- | IR_GRAPH_PROPERTY_CONSISTENT_LOOPINFO);
+ | IR_GRAPH_PROPERTY_CONSISTENT_LOOPINFO
+ | IR_GRAPH_PROPERTY_NO_UNREACHABLE_CODE);
}
}
@@ -184,6 +186,7 @@ static void fix_nothrow_call_list(ir_graph *irg, ir_node **call_list)
switch (get_Proj_num(proj)) {
case pn_Call_X_except:
exc_changed = true;
+ ir_set_throws_exception(call, false);
exchange(proj, new_r_Bad(irg, mode_X));
break;
case pn_Call_X_regular: {
@@ -202,7 +205,8 @@ static void fix_nothrow_call_list(ir_graph *irg, ir_node **call_list)
if (exc_changed) {
/* ... including exception edges */
clear_irg_properties(irg, IR_GRAPH_PROPERTY_CONSISTENT_DOMINANCE
- | IR_GRAPH_PROPERTY_CONSISTENT_LOOPINFO);
+ | IR_GRAPH_PROPERTY_CONSISTENT_LOOPINFO
+ | IR_GRAPH_PROPERTY_NO_UNREACHABLE_CODE);
}
}
@@ -838,6 +842,10 @@ void optimize_funccalls(void)
free(busy_set);
free(ready_set);
+
+ foreach_irp_irg(i, irg) {
+ assure_irg_properties(irg, IR_GRAPH_PROPERTY_NO_UNREACHABLE_CODE);
+ }
}
void firm_init_funccalls(void)