aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2015-04-27 12:46:58 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2015-04-27 12:46:58 +0000
commit05b7b5a4a1e9916e2f40e2d9d5c1bfb59ad06aaa (patch)
tree912db8bb1bb006f1037a916c025b4ce337b48a91 /gcc
parent991607ab258cae68d0f1fff0de15a15583892f15 (diff)
downloadgcc-05b7b5a4a1e9916e2f40e2d9d5c1bfb59ad06aaa.zip
gcc-05b7b5a4a1e9916e2f40e2d9d5c1bfb59ad06aaa.tar.gz
gcc-05b7b5a4a1e9916e2f40e2d9d5c1bfb59ad06aaa.tar.bz2
tree-ssa-dom.c (record_equivalences_from_phis): Valueize PHI arg.
2015-04-27 Richard Biener <rguenther@suse.de> * tree-ssa-dom.c (record_equivalences_from_phis): Valueize PHI arg. (record_equivalences_from_stmt): Valueize rhs. (record_equality): Canonicalize x and y order via tree_swap_operands_p. Do not swap operands for same loop depth. * gcc.target/i386/pr65217.c: XFAIL. From-SVN: r222463
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.target/i386/pr65217.c4
-rw-r--r--gcc/tree-ssa-dom.c41
4 files changed, 42 insertions, 14 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index be8560c..8f76eb6 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2015-04-27 Richard Biener <rguenther@suse.de>
+
+ * tree-ssa-dom.c (record_equivalences_from_phis): Valueize PHI arg.
+ (record_equivalences_from_stmt): Valueize rhs.
+ (record_equality): Canonicalize x and y order via
+ tree_swap_operands_p. Do not swap operands for same loop depth.
+
2015-04-27 Georg-Johann Lay <avr@gjlay.de>
PR target/65296
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index c25b518..c44dc28 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2015-04-27 Richard Biener <rguenther@suse.de>
+
+ * gcc.target/i386/pr65217.c: XFAIL.
+
2015-04-27 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/65875
diff --git a/gcc/testsuite/gcc.target/i386/pr65217.c b/gcc/testsuite/gcc.target/i386/pr65217.c
index d5c9be5..3f495b2 100644
--- a/gcc/testsuite/gcc.target/i386/pr65217.c
+++ b/gcc/testsuite/gcc.target/i386/pr65217.c
@@ -1,7 +1,7 @@
/* { dg-do compile } */
/* { dg-options "-O" } */
-/* { dg-final { scan-assembler-not "negl" } } */
-/* { dg-final { scan-assembler-not "andl" } } */
+/* { dg-final { scan-assembler-not "negl" { xfail *-*-* } } } */
+/* { dg-final { scan-assembler-not "andl" { xfail *-*-* } } } */
int
test(int n)
diff --git a/gcc/tree-ssa-dom.c b/gcc/tree-ssa-dom.c
index 355c84c..a67b4e4 100644
--- a/gcc/tree-ssa-dom.c
+++ b/gcc/tree-ssa-dom.c
@@ -1519,6 +1519,13 @@ record_equivalences_from_phis (basic_block bb)
if (lhs == t)
continue;
+ /* Valueize t. */
+ if (TREE_CODE (t) == SSA_NAME)
+ {
+ tree tmp = SSA_NAME_VALUE (t);
+ t = tmp ? tmp : t;
+ }
+
/* If we have not processed an alternative yet, then set
RHS to this alternative. */
if (rhs == NULL)
@@ -1752,6 +1759,9 @@ record_equality (tree x, tree y)
{
tree prev_x = NULL, prev_y = NULL;
+ if (tree_swap_operands_p (x, y, false))
+ std::swap (x, y);
+
if (TREE_CODE (x) == SSA_NAME)
prev_x = SSA_NAME_VALUE (x);
if (TREE_CODE (y) == SSA_NAME)
@@ -1766,7 +1776,7 @@ record_equality (tree x, tree y)
else if (is_gimple_min_invariant (x)
/* ??? When threading over backedges the following is important
for correctness. See PR61757. */
- || (loop_depth_of_name (x) <= loop_depth_of_name (y)))
+ || (loop_depth_of_name (x) < loop_depth_of_name (y)))
prev_x = x, x = y, y = prev_x, prev_x = prev_y;
else if (prev_x && is_gimple_min_invariant (prev_x))
x = y, y = prev_x, prev_x = prev_y;
@@ -2128,18 +2138,25 @@ record_equivalences_from_stmt (gimple stmt, int may_optimize_p)
if (may_optimize_p
&& (TREE_CODE (rhs) == SSA_NAME
|| is_gimple_min_invariant (rhs)))
- {
- if (dump_file && (dump_flags & TDF_DETAILS))
- {
- fprintf (dump_file, "==== ASGN ");
- print_generic_expr (dump_file, lhs, 0);
- fprintf (dump_file, " = ");
- print_generic_expr (dump_file, rhs, 0);
- fprintf (dump_file, "\n");
- }
+ {
+ /* Valueize rhs. */
+ if (TREE_CODE (rhs) == SSA_NAME)
+ {
+ tree tmp = SSA_NAME_VALUE (rhs);
+ rhs = tmp ? tmp : rhs;
+ }
- set_ssa_name_value (lhs, rhs);
- }
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ {
+ fprintf (dump_file, "==== ASGN ");
+ print_generic_expr (dump_file, lhs, 0);
+ fprintf (dump_file, " = ");
+ print_generic_expr (dump_file, rhs, 0);
+ fprintf (dump_file, "\n");
+ }
+
+ set_ssa_name_value (lhs, rhs);
+ }
}
/* Make sure we can propagate &x + CST. */