This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[tree-ssa] Cleanup avail_expr_hash


Jason sent me an alternative patch to deal with the hashing weirdness
I pointed out in my change from earlier today.  I prefer his patch to
mine and it produces identical code.

	* tree-ssa.c (avail_expr_hash): Simplify by using iterative_hash_expr
	in more places.

	* tree.c (iterative_hash_expr): Handle SSA_NAME.

Index: tree-ssa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-ssa.c,v
retrieving revision 1.1.4.82
diff -c -3 -p -r1.1.4.82 tree-ssa.c
*** tree-ssa.c	29 May 2003 20:40:32 -0000	1.1.4.82
--- tree-ssa.c	29 May 2003 23:08:21 -0000
*************** avail_expr_hash (p)
*** 2600,2609 ****
    for (i = 0; ops && i < VARRAY_ACTIVE_SIZE (ops); i++)
      {
        tree op = *((tree *) VARRAY_GENERIC_PTR (ops, i));
!       if (TREE_CODE (op) == SSA_NAME)
! 	val = iterative_hash_object (SSA_NAME_VERSION (op), val);
!       else
! 	val = iterative_hash_expr (op, val);
      }
  
    /* Add the SSA version numbers of every vuse operand.  This is important
--- 2600,2606 ----
    for (i = 0; ops && i < VARRAY_ACTIVE_SIZE (ops); i++)
      {
        tree op = *((tree *) VARRAY_GENERIC_PTR (ops, i));
!       val = iterative_hash_expr (op, val);
      }
  
    /* Add the SSA version numbers of every vuse operand.  This is important
*************** avail_expr_hash (p)
*** 2612,2618 ****
       representing all the elements of the array.  */
    ops = vuse_ops (stmt);
    for (i = 0; ops && i < VARRAY_ACTIVE_SIZE (ops); i++)
!     val = iterative_hash_object (SSA_NAME_VERSION (VARRAY_TREE (ops, i)), 
val);
  
    return val;
  }
--- 2609,2615 ----
       representing all the elements of the array.  */
    ops = vuse_ops (stmt);
    for (i = 0; ops && i < VARRAY_ACTIVE_SIZE (ops); i++)
!     val = iterative_hash_expr (VARRAY_TREE (ops, i), val);
  
    return val;
  }
Index: tree.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree.c,v
retrieving revision 1.263.2.34
diff -c -3 -p -r1.263.2.34 tree.c
*** tree.c	27 May 2003 22:50:28 -0000	1.263.2.34
--- tree.c	29 May 2003 23:08:35 -0000
*************** iterative_hash_expr (tree t, hashval_t v
*** 3608,3613 ****
--- 3608,3618 ----
        for (; t; t = TREE_CHAIN (t))
  	val = iterative_hash_expr (TREE_VALUE (t), val);
      }
+   else if (code == SSA_NAME)
+     {
+       val = iterative_hash_object (SSA_NAME_VERSION (t), val);
+       val = iterative_hash_expr (SSA_NAME_VAR (t), val);
+     }
    else
      abort ();
  





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]