diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2015-02-10 04:13:42 -0800 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2015-02-10 04:13:42 -0800 |
commit | 9547f24e09cb9cf4db70f0ad308d2f03015c7d81 (patch) | |
tree | 16b168d8b010c84e72d37f9aa22e216d5a2a8b3d /gcc/tree-predcom.c | |
parent | 5a28f86b322357cb07d2ae3a42fa39f0749cf9f2 (diff) | |
parent | ae10eb82fe34c18640ad65c2ab94ffc53f349315 (diff) | |
download | gcc-hjl/x32/gcc-4_7-branch.tar.gz |
Merge remote-tracking branch 'origin/gcc-4_7-branch' into hjl/x32/gcc-4_7-branchhjl/x32/gcc-4_7-branch
Diffstat (limited to 'gcc/tree-predcom.c')
-rw-r--r-- | gcc/tree-predcom.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/tree-predcom.c b/gcc/tree-predcom.c index 1566902e3d7..61a1c741d1c 100644 --- a/gcc/tree-predcom.c +++ b/gcc/tree-predcom.c @@ -2117,7 +2117,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); |