From 3834917dbfa662ad3c358508dc40e3b7f4c70182 Mon Sep 17 00:00:00 2001 From: Michael Matz Date: Wed, 8 Sep 2010 12:34:52 +0000 Subject: 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 --- gcc/tree-ssa-sink.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'gcc/tree-ssa-sink.c') 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)) -- cgit v1.1