This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] Sanity checking + hashing fix
- From: law at redhat dot com
- To: Jason Merrill <jason at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 24 Jun 2003 20:47:47 -0600
- Subject: Re: [tree-ssa] Sanity checking + hashing fix
- Reply-to: law at redhat dot com
In message <wvl3ciec45l.fsf@prospero.boston.redhat.com>, Jason Merrill writes:
>On Thu, 12 Jun 2003 15:28:35 -0600, law@redhat.com wrote:
>
>> operand_equal_p doesn't look at the types of NOP_EXPRs and friends --
>> it looks at the signedness of the type and the object being converted.
>>
>> iterative_hash_expr hashed the type using the type's address.
>
>I dealt with this by checking type identity in gimple_tree_eq before
>handing off to operand_equal_p. I don't think we want to ignore type
>differences.
Agreed. Though one could argue that operand_equal_p should be doing
some of these checks itself.
* tree-ssa.c (avail_expr_eq): Verify types are the same before
handing expressions to operand_equal_p.
Index: tree-ssa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-ssa.c,v
retrieving revision 1.1.4.96
diff -c -3 -p -r1.1.4.96 tree-ssa.c
*** tree-ssa.c 24 Jun 2003 23:03:44 -0000 1.1.4.96
--- tree-ssa.c 25 Jun 2003 02:47:49 -0000
*************** avail_expr_eq (const void *p1, const voi
*** 2695,2701 ****
/* In case of a collision, both RHS have to be identical and have the
same VUSE operands. */
! if (TREE_CODE (rhs1) == TREE_CODE (rhs2) && operand_equal_p (rhs1, rhs2,
0))
{
varray_type ops1 = vuse_ops (s1);
varray_type ops2 = vuse_ops (s2);
--- 2695,2703 ----
/* In case of a collision, both RHS have to be identical and have the
same VUSE operands. */
! if (TREE_CODE (rhs1) == TREE_CODE (rhs2)
! && TREE_TYPE (rhs1) == TREE_TYPE (rhs2)
! && operand_equal_p (rhs1, rhs2, 0))
{
varray_type ops1 = vuse_ops (s1);
varray_type ops2 = vuse_ops (s2);