summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-sink.c
diff options
context:
space:
mode:
authorcarrot <carrot@138bc75d-0d04-0410-961f-82ee72b054a4>2009-06-30 06:51:29 +0000
committercarrot <carrot@138bc75d-0d04-0410-961f-82ee72b054a4>2009-06-30 06:51:29 +0000
commit258b3d02759d4e9bae097095928ab33bf5b18682 (patch)
treee6e40e470bbb22fbfafc92b65320e222942f2723 /gcc/tree-ssa-sink.c
parent5f29861f01cfbd13733f595c95bc50b33bc86839 (diff)
downloadgcc-258b3d02759d4e9bae097095928ab33bf5b18682.tar.gz
* tree-ssa-sink.c (statement_sink_location): Stop sinking expression
if the target bb post dominates from bb. * config/i386/i386.c (memory_address_length): Check existence of base register before using it. * gcc.dg/tree-ssa/ssa-sink-5.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@149082 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-sink.c')
-rw-r--r--gcc/tree-ssa-sink.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/tree-ssa-sink.c b/gcc/tree-ssa-sink.c
index 227ad11253c..4f16addb323 100644
--- a/gcc/tree-ssa-sink.c
+++ b/gcc/tree-ssa-sink.c
@@ -384,6 +384,11 @@ statement_sink_location (gimple stmt, basic_block frombb,
|| sinkbb->loop_father != frombb->loop_father)
return false;
+ /* Move the expression to a post dominator can't reduce the number of
+ executions. */
+ if (dominated_by_p (CDI_POST_DOMINATORS, frombb, sinkbb))
+ return false;
+
*togsi = gsi_for_stmt (use);
return true;
}
@@ -411,6 +416,11 @@ statement_sink_location (gimple stmt, basic_block frombb,
|| sinkbb->loop_father != frombb->loop_father)
return false;
+ /* Move the expression to a post dominator can't reduce the number of
+ executions. */
+ if (dominated_by_p (CDI_POST_DOMINATORS, frombb, sinkbb))
+ return false;
+
*togsi = gsi_after_labels (sinkbb);
return true;