summaryrefslogtreecommitdiff
path: root/gcc/tree-predcom.c
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2013-11-20 13:32:32 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2013-11-20 13:32:32 +0000
commitfe5ad9266cba2cbb611a831aaac450d3f6decd0c (patch)
treea1dce161550e71aa81d0af00e118e4f68d907995 /gcc/tree-predcom.c
parent6715fbd40b05c43941c4d4e093cceb5345a695e7 (diff)
parent8c53c46cebf42cb4f4ac125ca6428c5e9b519f66 (diff)
downloadgcc-fe5ad9266cba2cbb611a831aaac450d3f6decd0c.tar.gz
Merge from trunk.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/wide-int@205111 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-predcom.c')
-rw-r--r--gcc/tree-predcom.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/gcc/tree-predcom.c b/gcc/tree-predcom.c
index 338b0ff2ea8..55dd7c32475 100644
--- a/gcc/tree-predcom.c
+++ b/gcc/tree-predcom.c
@@ -198,12 +198,14 @@ along with GCC; see the file COPYING3. If not see
#include "gimple-ssa.h"
#include "tree-phinodes.h"
#include "ssa-iterators.h"
+#include "stringpool.h"
#include "tree-ssanames.h"
#include "tree-ssa-loop-ivopts.h"
#include "tree-ssa-loop-manip.h"
#include "tree-ssa-loop-niter.h"
#include "tree-ssa-loop.h"
#include "tree-into-ssa.h"
+#include "expr.h"
#include "tree-dfa.h"
#include "tree-ssa.h"
#include "ggc.h"
@@ -2035,7 +2037,11 @@ combinable_refs_p (dref r1, dref r2,
stmt = find_common_use_stmt (&name1, &name2);
- if (!stmt)
+ if (!stmt
+ /* A simple post-dominance check - make sure the combination
+ is executed under the same condition as the references. */
+ || (gimple_bb (stmt) != gimple_bb (r1->stmt)
+ && gimple_bb (stmt) != gimple_bb (r2->stmt)))
return false;
acode = gimple_assign_rhs_code (stmt);
@@ -2505,11 +2511,10 @@ tree_predictive_commoning (void)
{
bool unrolled = false;
struct loop *loop;
- loop_iterator li;
unsigned ret = 0;
initialize_original_copy_tables ();
- FOR_EACH_LOOP (li, loop, LI_ONLY_INNERMOST)
+ FOR_EACH_LOOP (loop, LI_ONLY_INNERMOST)
if (optimize_loop_for_speed_p (loop))
{
unrolled |= tree_predictive_commoning_loop (loop);