aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.7/gcc/tree-ssa-math-opts.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.7/gcc/tree-ssa-math-opts.c')
-rw-r--r--gcc-4.7/gcc/tree-ssa-math-opts.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc-4.7/gcc/tree-ssa-math-opts.c b/gcc-4.7/gcc/tree-ssa-math-opts.c
index a00541fbd..077e88a63 100644
--- a/gcc-4.7/gcc/tree-ssa-math-opts.c
+++ b/gcc-4.7/gcc/tree-ssa-math-opts.c
@@ -1387,12 +1387,18 @@ execute_cse_sincos (void)
FOR_EACH_BB (bb)
{
gimple_stmt_iterator gsi;
+ bool cleanup_eh = false;
for (gsi = gsi_after_labels (bb); !gsi_end_p (gsi); gsi_next (&gsi))
{
gimple stmt = gsi_stmt (gsi);
tree fndecl;
+ /* Only the last stmt in a bb could throw, no need to call
+ gimple_purge_dead_eh_edges if we change something in the middle
+ of a basic block. */
+ cleanup_eh = false;
+
if (is_gimple_call (stmt)
&& gimple_call_lhs (stmt)
&& (fndecl = gimple_call_fndecl (stmt))
@@ -1430,6 +1436,7 @@ execute_cse_sincos (void)
gimple_set_location (new_stmt, loc);
unlink_stmt_vdef (stmt);
gsi_replace (&gsi, new_stmt, true);
+ cleanup_eh = true;
}
break;
@@ -1450,6 +1457,7 @@ execute_cse_sincos (void)
gimple_set_location (new_stmt, loc);
unlink_stmt_vdef (stmt);
gsi_replace (&gsi, new_stmt, true);
+ cleanup_eh = true;
}
break;
@@ -1465,6 +1473,7 @@ execute_cse_sincos (void)
gimple_set_location (new_stmt, loc);
unlink_stmt_vdef (stmt);
gsi_replace (&gsi, new_stmt, true);
+ cleanup_eh = true;
}
break;
@@ -1472,6 +1481,8 @@ execute_cse_sincos (void)
}
}
}
+ if (cleanup_eh)
+ cfg_changed |= gimple_purge_dead_eh_edges (bb);
}
statistics_counter_event (cfun, "sincos statements inserted",