combine.c (combine_simplify_rtx): Don't convert -(A*B) into (-A)*B if we care about...
authorRoger Sayle <roger@eyesopen.com>
Sun, 7 Sep 2003 20:32:16 +0000 (20:32 +0000)
committerRoger Sayle <sayle@gcc.gnu.org>
Sun, 7 Sep 2003 20:32:16 +0000 (20:32 +0000)
* combine.c (combine_simplify_rtx): Don't convert -(A*B) into
(-A)*B if we care about sign-dependent rounding.

From-SVN: r71178

gcc/ChangeLog
gcc/combine.c

index d907564ec68457615b7a5181b15868fc4e7a277b..5b10868d6476adfa3c02880de3c5fe3851e0723d 100644 (file)
@@ -1,3 +1,8 @@
+2003-09-07  Roger Sayle  <roger@eyesopen.com>
+
+       * combine.c (combine_simplify_rtx): Don't convert -(A*B) into
+       (-A)*B if we care about sign-dependent rounding.
+
 2003-09-07  Gabriel Dos Reis  <gcc@integrable-solutions.net>
 
        * c-pretty-print.h (pp_c_left_brace): Declare.
index 26cdf49dc78483ca1fc2498e2677f7b167f16883..0853a2cc5f9658f4845f9476f8808a9600f8a49a 100644 (file)
@@ -3970,14 +3970,16 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int last,
 
       /* (neg (mult A B)) becomes (mult (neg A) B).
          This works even for floating-point values.  */
-      if (GET_CODE (XEXP (x, 0)) == MULT)
+      if (GET_CODE (XEXP (x, 0)) == MULT
+         && !HONOR_SIGN_DEPENDENT_ROUNDING (mode))
        {
          temp = simplify_gen_unary (NEG, mode, XEXP (XEXP (x, 0), 0), mode);
          return gen_binary (MULT, mode, temp, XEXP (XEXP (x, 0), 1));
        }
 
       /* (neg (xor A 1)) is (plus A -1) if A is known to be either 0 or 1.  */
-      if (GET_CODE (XEXP (x, 0)) == XOR && XEXP (XEXP (x, 0), 1) == const1_rtx
+      if (GET_CODE (XEXP (x, 0)) == XOR
+         && XEXP (XEXP (x, 0), 1) == const1_rtx
          && nonzero_bits (XEXP (XEXP (x, 0), 0), mode) == 1)
        return gen_binary (PLUS, mode, XEXP (XEXP (x, 0), 0), constm1_rtx);