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]

Request for testing on fold-const.c patch


Can somebody who had the "random" failure in bootstrap caused by the
comparison/hashing failures in ARRAY_REF please verify that this patch
doesn't make them come back?  This is the clean way of doing the comparison
and I can (and did) test it in the conventional way, but since I never
had the random problems, I can't verify that this doesn't bring them back.

2004-07-25  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>

	* fold-const.c (operand_equal_p): Localize null test to COMPONENT_REF,
	ARRAY_REF and ARRAY_RANGE_REF.
	
*** fold-const.c	22 Jul 2004 20:33:28 -0000	1.429
--- fold-const.c	25 Jul 2004 13:28:00 -0000
*************** int
*** 2346,2360 ****
  operand_equal_p (tree arg0, tree arg1, unsigned int flags)
  {
-   /* If one is specified and the other isn't, they aren't equal and if
-      neither is specified, they are.
- 
-      ??? This is temporary and is meant only to handle the cases of the
-      optional operands for COMPONENT_REF and ARRAY_REF.  */
-   if ((arg0 && !arg1) || (!arg0 && arg1))
-     return 0;
-   else if (!arg0 && !arg1)
-     return 1;
    /* If either is ERROR_MARK, they aren't equal.  */
!   else if (TREE_CODE (arg0) == ERROR_MARK || TREE_CODE (arg1) == ERROR_MARK)
      return 0;
  
--- 2346,2351 ----
  operand_equal_p (tree arg0, tree arg1, unsigned int flags)
  {
    /* If either is ERROR_MARK, they aren't equal.  */
!   if (TREE_CODE (arg0) == ERROR_MARK || TREE_CODE (arg1) == ERROR_MARK)
      return 0;
  
*************** operand_equal_p (tree arg0, tree arg1, u
*** 2492,2513 ****
  	case ARRAY_REF:
  	case ARRAY_RANGE_REF:
  	  return (operand_equal_p (TREE_OPERAND (arg0, 0),
  				   TREE_OPERAND (arg1, 0), flags)
  		  && operand_equal_p (TREE_OPERAND (arg0, 1),
  				      TREE_OPERAND (arg1, 1), flags)
! 		  && operand_equal_p (TREE_OPERAND (arg0, 2),
! 				      TREE_OPERAND (arg1, 2), flags)
! 		  && operand_equal_p (TREE_OPERAND (arg0, 3),
! 				      TREE_OPERAND (arg1, 3), flags));
! 
  
  	case COMPONENT_REF:
  	  return (operand_equal_p (TREE_OPERAND (arg0, 0),
  				   TREE_OPERAND (arg1, 0), flags)
  		  && operand_equal_p (TREE_OPERAND (arg0, 1),
  				      TREE_OPERAND (arg1, 1), flags)
! 		  && operand_equal_p (TREE_OPERAND (arg0, 2),
! 				      TREE_OPERAND (arg1, 2), flags));
! 
  
  	case BIT_FIELD_REF:
--- 2483,2512 ----
  	case ARRAY_REF:
  	case ARRAY_RANGE_REF:
+ 	  /* For operands 2 and 3, if either ARG0 or ARG1 is NULL, then
+ 	     the other must be identical.  Otherwise, it's enough that
+ 	     operand_equal_p be true.  */
  	  return (operand_equal_p (TREE_OPERAND (arg0, 0),
  				   TREE_OPERAND (arg1, 0), flags)
  		  && operand_equal_p (TREE_OPERAND (arg0, 1),
  				      TREE_OPERAND (arg1, 1), flags)
! 		  && ((!TREE_OPERAND (arg0, 2) || !TREE_OPERAND (arg1, 2))
! 		      ? TREE_OPERAND (arg0, 2) == TREE_OPERAND (arg1, 2)
! 		      : operand_equal_p (TREE_OPERAND (arg0, 2),
! 					 TREE_OPERAND (arg1, 2), flags))
! 		  && ((!TREE_OPERAND (arg0, 3) || !TREE_OPERAND (arg1, 3))
! 		      ? TREE_OPERAND (arg0, 3) == TREE_OPERAND (arg1, 3)
! 		      : operand_equal_p (TREE_OPERAND (arg0, 3),
! 					 TREE_OPERAND (arg1, 3), flags)));
  
  	case COMPONENT_REF:
+ 	  /* Handle operand 2 the same as for ARRAY_REF.  */
  	  return (operand_equal_p (TREE_OPERAND (arg0, 0),
  				   TREE_OPERAND (arg1, 0), flags)
  		  && operand_equal_p (TREE_OPERAND (arg0, 1),
  				      TREE_OPERAND (arg1, 1), flags)
! 		  && ((!TREE_OPERAND (arg0, 2) || !TREE_OPERAND (arg1, 2))
! 		      ? TREE_OPERAND (arg0, 2) == TREE_OPERAND (arg1, 2)
! 		      : operand_equal_p (TREE_OPERAND (arg0, 2),
! 					 TREE_OPERAND (arg1, 2), flags)));
  
  	case BIT_FIELD_REF:


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