aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-sink.c
diff options
context:
space:
mode:
authorMichael Matz <matz@suse.de>2010-09-08 12:34:52 +0000
committerMichael Matz <matz@gcc.gnu.org>2010-09-08 12:34:52 +0000
commit3834917dbfa662ad3c358508dc40e3b7f4c70182 (patch)
tree40333867cd2cdc114ffbe072682c1206a8847164 /gcc/tree-ssa-sink.c
parentb5c878a5159f7d60f0c451b25888bcb2af4025e5 (diff)
downloadgcc-3834917dbfa662ad3c358508dc40e3b7f4c70182.zip
gcc-3834917dbfa662ad3c358508dc40e3b7f4c70182.tar.gz
gcc-3834917dbfa662ad3c358508dc40e3b7f4c70182.tar.bz2
re PR tree-optimization/33244 (Missed opportunities for vectorization)
PR tree-optimization/33244 * tree-ssa-sink.c (statement_sink_location): Don't sink into empty loop latches. testsuite/ PR tree-optimization/33244 * gfortran.dg/vect/fast-math-vect-8.f90: New test. From-SVN: r163998
Diffstat (limited to 'gcc/tree-ssa-sink.c')
-rw-r--r--gcc/tree-ssa-sink.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/tree-ssa-sink.c b/gcc/tree-ssa-sink.c
index 436047b..bfa1a31 100644
--- a/gcc/tree-ssa-sink.c
+++ b/gcc/tree-ssa-sink.c
@@ -429,6 +429,12 @@ statement_sink_location (gimple stmt, basic_block frombb,
|| sinkbb->loop_father != frombb->loop_father)
return false;
+ /* If the latch block is empty, don't make it non-empty by sinking
+ something into it. */
+ if (sinkbb == frombb->loop_father->latch
+ && empty_block_p (sinkbb))
+ 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))