On 09-01-14 10:16, Richard Biener wrote:

This fixes PR59715 by splitting critical edges again before
code sinking.  The critical edge splitting done before PRE
was designed to survive until sinking originally, but at least
since 4.5 PRE now eventually cleans up the CFG and thus undos
critical edge splitting.  This results in less than optimal
code placement (and lost opportunities) for sinking and it
breaks (at least) the virtual operand updating code which
assumes that critical edges are still split.


Richard,

this follow-up patch:
- notes in pass_pre that PROP_no_crit_edge is destroyed
- notes in pass_sink_code that PROP_no_crit_edge is not required
  (because it's now ensured by the pass itself)

Build and reg-tested pr59715.c on x86_64.

OK for stage3 trunk if bootstrap and full reg-test on x86_64 is ok?

Thanks,
- Tom

2014-01-09  Tom de Vries  <t...@codesourcery.com>

	* tree-ssa-pre.c (pass_data_pre): Add comment about PROP_no_crit_edges
	in properties_required.  Add PROP_no_crit_edges to properties_destroyed.
	* tree-ssa-sink.c (pass_data_sink_code): Comment out PROP_no_crit_edges
	in PROP_no_crit_edges.

diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c
index 2de5db5..1e55356 100644
--- a/gcc/tree-ssa-pre.c
+++ b/gcc/tree-ssa-pre.c
@@ -4798,9 +4798,11 @@ const pass_data pass_data_pre =
   true, /* has_gate */
   true, /* has_execute */
   TV_TREE_PRE, /* tv_id */
+  /* PROP_no_crit_edges is ensured by placing pass_split_crit_edges before
+     pass_pre.  */
   ( PROP_no_crit_edges | PROP_cfg | PROP_ssa ), /* properties_required */
   0, /* properties_provided */
-  0, /* properties_destroyed */
+  PROP_no_crit_edges, /* properties_destroyed */
   TODO_rebuild_alias, /* todo_flags_start */
   TODO_verify_ssa, /* todo_flags_finish */
 };
diff --git a/gcc/tree-ssa-sink.c b/gcc/tree-ssa-sink.c
index a72a9e8..b56c4fe 100644
--- a/gcc/tree-ssa-sink.c
+++ b/gcc/tree-ssa-sink.c
@@ -604,7 +604,9 @@ const pass_data pass_data_sink_code =
   true, /* has_gate */
   true, /* has_execute */
   TV_TREE_SINK, /* tv_id */
-  ( PROP_no_crit_edges | PROP_cfg | PROP_ssa ), /* properties_required */
+  /* PROP_no_crit_edges is ensured by running split_critical_edges in
+     execute_sink_code.  */
+  ( /* PROP_no_crit_edges | */ PROP_cfg | PROP_ssa ), /* properties_required */
   0, /* properties_provided */
   0, /* properties_destroyed */
   0, /* todo_flags_start */

Reply via email to