Minor fold-const.c bugfix

Richard Kenner kenner@vlsi1.ultra.nyu.edu
Thu Oct 5 06:35:00 GMT 2000


Thu Oct  5 09:31:31 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>

	* fold-const.c (fold, case MINUS_EXPR, case EQ_EXPR): Perform
	negation in proper type.a

*** fold-const.c	2000/08/24 20:31:31	1.131
--- fold-const.c	2000/10/05 13:09:37
*************** fold (expr)
*** 5577,5581 ****
  	{
  	  if (! wins && integer_zerop (arg0))
! 	    return convert (type, negate_expr (arg1));
  	  if (integer_zerop (arg1))
  	    return non_lvalue (convert (type, arg0));
--- 5577,5581 ----
  	{
  	  if (! wins && integer_zerop (arg0))
! 	    return negate_expr (convert (type, arg1));
  	  if (integer_zerop (arg1))
  	    return non_lvalue (convert (type, arg0));
*************** fold (expr)
*** 5600,5604 ****
  	  /* Except with IEEE floating point, 0-x equals -x.  */
  	  if (! wins && real_zerop (arg0))
! 	    return convert (type, negate_expr (arg1));
  	  /* Except with IEEE floating point, x-0 equals x.  */
  	  if (real_zerop (arg1))
--- 5600,5604 ----
  	  /* Except with IEEE floating point, 0-x equals -x.  */
  	  if (! wins && real_zerop (arg0))
! 	    return negate_expr (convert (type, arg1));
  	  /* Except with IEEE floating point, x-0 equals x.  */
  	  if (real_zerop (arg1))
*************** fold (expr)
*** 6889,6893 ****
  	      case EQ_EXPR:
  		return
! 		  pedantic_non_lvalue (convert (type, negate_expr (arg1)));
  	      case NE_EXPR:
  		return pedantic_non_lvalue (convert (type, arg1));
--- 6889,6898 ----
  	      case EQ_EXPR:
  		return
! 		  pedantic_non_lvalue
! 		    (convert (type,
! 			      negate_expr
! 			      (convert (TREE_TYPE (TREE_OPERAND (t, 1)),
! 					arg1))));
! 
  	      case NE_EXPR:
  		return pedantic_non_lvalue (convert (type, arg1));


More information about the Gcc-patches mailing list