cse.c (find_comparison_args): Check that we can reverse a comparison if needed before...
authorRichard Henderson <rth@redhat.com>
Thu, 26 Oct 2000 00:17:53 +0000 (17:17 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Thu, 26 Oct 2000 00:17:53 +0000 (17:17 -0700)
        * cse.c (find_comparison_args): Check that we can reverse a
        comparison if needed before accepting the substitution.

From-SVN: r37064

gcc/ChangeLog
gcc/cse.c

index 03aa3176d48994641181c8402556dd5a2dd23ef6..3edb9b2bff5555910d887f3d3407556dc8870d48 100644 (file)
@@ -1,3 +1,8 @@
+2000-10-25  Richard Henderson  <rth@redhat.com>
+
+       * cse.c (find_comparison_args): Check that we can reverse a
+       comparison if needed before accepting the substitution.
+
 2000-10-25  Richard Henderson  <rth@redhat.com>
 
        * reload.c (find_reloads_address_part): Kill rtx obstack hackery.
index ac9ae6be46cefcb1fedbb493565b98c3175ff9a5..17d35ceff76cbe6c9f8968cbbce514a0dfebcb8f 100644 (file)
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -3234,6 +3234,12 @@ find_comparison_args (code, parg1, parg2, pmode1, pmode2)
       if (x == 0)
        break;
 
+      /* If we need to reverse the comparison, make sure that that is
+        possible -- we can't necessarily infer the value of GE from LT
+        with floating-point operands.  */
+      if (reverse_code && ! can_reverse_comparison_p (x, NULL_RTX))
+       break;
+
       arg1 = XEXP (x, 0), arg2 = XEXP (x, 1);
       if (GET_RTX_CLASS (GET_CODE (x)) == '<')
        code = GET_CODE (x);