2012-09-20 Jakub Jelinek <jakub@redhat.com>
Backported from mainline
+ 2012-09-17 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/54563
+ * tree-ssa-math-opts.c (execute_cse_sincos): Call
+ gimple_purge_dead_eh_edges if last call has been changed.
+
2012-09-14 Jakub Jelinek <jakub@redhat.com>
PR target/54564
/* Global, SSA-based optimizations using mathematical identities.
- Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011
+ Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
Free Software Foundation, Inc.
This file is part of GCC.
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))
gimple_set_location (new_stmt, loc);
unlink_stmt_vdef (stmt);
gsi_replace (&gsi, new_stmt, true);
+ cleanup_eh = true;
}
break;
gimple_set_location (new_stmt, loc);
unlink_stmt_vdef (stmt);
gsi_replace (&gsi, new_stmt, true);
+ cleanup_eh = true;
}
break;
gimple_set_location (new_stmt, loc);
unlink_stmt_vdef (stmt);
gsi_replace (&gsi, new_stmt, true);
+ cleanup_eh = true;
}
break;
}
}
}
+ if (cleanup_eh)
+ cfg_changed |= gimple_purge_dead_eh_edges (bb);
}
statistics_counter_event (cfun, "sincos statements inserted",