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]

fold-const.c fix




I installed this into the egcs tree:

        * fold-const.c (fold): Fix typo in COND_EXPR handling code.
        (invert_truthvalue): Enable truthvalue inversion for
        floating-point operands if -ffast-math.


Index: fold-const.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/./gcc/fold-const.c,v
retrieving revision 1.45
diff -c -3 -p -r1.45 fold-const.c
*** fold-const.c	1998/08/17 11:39:29	1.45
--- fold-const.c	1998/09/20 06:23:45
*************** invert_truthvalue (arg)
*** 2230,2236 ****
    if (TREE_CODE_CLASS (code) == '<')
      {
        if (FLOAT_TYPE_P (TREE_TYPE (TREE_OPERAND (arg, 0)))
! 	  && code != NE_EXPR && code != EQ_EXPR)
  	return build1 (TRUTH_NOT_EXPR, type, arg);
        else
  	return build (invert_tree_comparison (code), type,
--- 2230,2236 ----
    if (TREE_CODE_CLASS (code) == '<')
      {
        if (FLOAT_TYPE_P (TREE_TYPE (TREE_OPERAND (arg, 0)))
! 	  && !flag_fast_math && code != NE_EXPR && code != EQ_EXPR)
  	return build1 (TRUTH_NOT_EXPR, type, arg);
        else
  	return build (invert_tree_comparison (code), type,
*************** fold (expr) 
*** 5824,5830 ****
  	      t = build (code, type, tem,
  			 TREE_OPERAND (t, 2), TREE_OPERAND (t, 1));
  	      arg0 = tem;
! 	      arg1 = TREE_OPERAND (t, 2);
  	      STRIP_NOPS (arg1);
  	    }
  	}
--- 5824,5831 ----
  	      t = build (code, type, tem,
  			 TREE_OPERAND (t, 2), TREE_OPERAND (t, 1));
  	      arg0 = tem;
! 	      /* arg1 should be the first argument of the new T.  */
! 	      arg1 = TREE_OPERAND (t, 1);
  	      STRIP_NOPS (arg1);
  	    }
  	}


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