OSDN Git Service

2008-10-04 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 4 Oct 2008 14:19:48 +0000 (14:19 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 4 Oct 2008 14:19:48 +0000 (14:19 +0000)
* tree-ssa-sccvn.c (vn_reference_op_eq): Use types_compatible_p
instead of pointer equality.
(vn_nary_op_eq): Likewise.

* gcc.dg/tree-ssa/ssa-pre-21.c: New testcase.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@140868 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-21.c [new file with mode: 0644]
gcc/tree-ssa-sccvn.c

index ce0d95a..30fe245 100644 (file)
@@ -1,3 +1,9 @@
+2008-10-04  Richard Guenther  <rguenther@suse.de>
+
+       * tree-ssa-sccvn.c (vn_reference_op_eq): Use types_compatible_p
+       instead of pointer equality.
+       (vn_nary_op_eq): Likewise.
+
 2008-10-03  Andrew Pinski  <andrew_pinski@playstation.sony.com>
 
        * config/rs6000/rs6000.md (fseldfsf4): Add TARGET_SINGLE_FLOAT 
index 9078edc..c0687c9 100644 (file)
@@ -1,3 +1,7 @@
+2008-10-04  Richard Guenther  <rguenther@suse.de>
+
+       * gcc.dg/tree-ssa/ssa-pre-21.c: New testcase.
+
 2008-10-03  Jakub Jelinek  <jakub@redhat.com>
 
        PR debug/37726
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-21.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-21.c
new file mode 100644 (file)
index 0000000..65a73d2
--- /dev/null
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-pre" } */
+
+long
+NumSift (long *array, unsigned long k)
+{
+  if (array[k] < array[k + 1L])
+    ++k;
+  return array[k];
+}
+
+/* There should be only two loads left.  */
+
+/* { dg-final { scan-tree-dump-times "= \\\*D" 2 "pre" } } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
index 290b308..082a278 100644 (file)
@@ -387,7 +387,7 @@ vn_reference_op_eq (const void *p1, const void *p2)
   const_vn_reference_op_t const vro1 = (const_vn_reference_op_t) p1;
   const_vn_reference_op_t const vro2 = (const_vn_reference_op_t) p2;
   return vro1->opcode == vro2->opcode
-    && vro1->type == vro2->type
+    && types_compatible_p (vro1->type, vro2->type)
     && expressions_equal_p (vro1->op0, vro2->op0)
     && expressions_equal_p (vro1->op1, vro2->op1)
     && expressions_equal_p (vro1->op2, vro2->op2);
@@ -1184,7 +1184,7 @@ vn_nary_op_eq (const void *p1, const void *p2)
   unsigned i;
 
   if (vno1->opcode != vno2->opcode
-      || vno1->type != vno2->type)
+      || !types_compatible_p (vno1->type, vno2->type))
     return false;
 
   for (i = 0; i < vno1->length; ++i)