aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-sink.c
diff options
context:
space:
mode:
authorWei Guozhi <carrot@google.com>2009-06-30 06:51:29 +0000
committerWei Guozhi <carrot@gcc.gnu.org>2009-06-30 06:51:29 +0000
commit791b59e35bd36fce29aea0f0f16ec65b1c6ace14 (patch)
treee6e40e470bbb22fbfafc92b65320e222942f2723 /gcc/tree-ssa-sink.c
parent6d984927d5e07a5ecce8a0a029885db94ffdb266 (diff)
downloadgcc-791b59e35bd36fce29aea0f0f16ec65b1c6ace14.zip
gcc-791b59e35bd36fce29aea0f0f16ec65b1c6ace14.tar.gz
gcc-791b59e35bd36fce29aea0f0f16ec65b1c6ace14.tar.bz2
tree-ssa-sink.c (statement_sink_location): Stop sinking expression if the target bb post dominates from bb.
* 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. From-SVN: r149082
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 227ad11..4f16add 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;