]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
simplify-rtx.c (simplify_relational_operation): If flag_wrapv is set...
authorPaolo Bonzini <bonzini@gnu.org>
Fri, 5 Mar 2004 10:41:27 +0000 (10:41 +0000)
committerPaolo Bonzini <bonzini@gcc.gnu.org>
Fri, 5 Mar 2004 10:41:27 +0000 (10:41 +0000)
2004-03-05  Paolo Bonzini  <bonzini@gnu.org>

* simplify-rtx.c (simplify_relational_operation): If
        flag_wrapv is set, do not move terms between the two
        side of a relational operator.

From-SVN: r78962

gcc/ChangeLog
gcc/simplify-rtx.c

index 00236182f83719fa08d69e66d80909fadb746f3e..723492a658a725b53c980169f7ac96ac6e075497 100644 (file)
@@ -1,3 +1,9 @@
+2004-03-05  Paolo Bonzini  <bonzini@gnu.org>
+
+       * simplify-rtx.c (simplify_relational_operation): If
+       flag_wrapv is set, do not move terms between the two
+       side of a relational operator.
+
 2004-03-05  Paolo Bonzini  <bonzini@gnu.org>
 
        * rtlanal.c: Include target.h and output.h
index bae37f870a2eafd3637348dcb36f54de79c460e9..b86a8b214734087a6a05a5102e9d4debbaad65e9 100644 (file)
@@ -2559,9 +2559,10 @@ simplify_relational_operation (enum rtx_code code, enum machine_mode mode,
      If CODE is an unsigned comparison, then we can never do this optimization,
      because it gives an incorrect result if the subtraction wraps around zero.
      ANSI C defines unsigned operations such that they never overflow, and
-     thus such cases can not be ignored.  */
+     thus such cases can not be ignored; but we cannot do it even for
+     signed comparisons for languages such as Java, so test flag_wrapv.  */
 
-  if (INTEGRAL_MODE_P (mode) && trueop1 != const0_rtx
+  if (!flag_wrapv && INTEGRAL_MODE_P (mode) && trueop1 != const0_rtx
       && ! ((GET_CODE (op0) == REG || GET_CODE (trueop0) == CONST_INT)
            && (GET_CODE (op1) == REG || GET_CODE (trueop1) == CONST_INT))
       && 0 != (tem = simplify_binary_operation (MINUS, mode, op0, op1))