tree-ssa-sccvn.c (vn_reference_op_eq): Use types_compatible_p instead of pointer equality.

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.

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

From-SVN: r140868
This commit is contained in:
Richard Guenther 2008-10-04 14:19:48 +00:00 committed by Richard Biener
parent f913dcd658
commit 63a14fa3cd
4 changed files with 27 additions and 2 deletions

View 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

View 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

View File

@ -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" } } */

View 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)