aboutsummaryrefslogtreecommitdiff
path: root/gcc/cse.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2000-10-25 17:17:53 -0700
committerRichard Henderson <rth@gcc.gnu.org>2000-10-25 17:17:53 -0700
commit78192b0984feaab04d373d0754d06d8a7cd623f3 (patch)
tree8a8d4bbdf0a7cc70a66fa6ce4768a4ea50749ec3 /gcc/cse.c
parent07b5e470a6e5a28f5e887d65c98174318b940812 (diff)
downloadgcc-78192b0984feaab04d373d0754d06d8a7cd623f3.zip
gcc-78192b0984feaab04d373d0754d06d8a7cd623f3.tar.gz
gcc-78192b0984feaab04d373d0754d06d8a7cd623f3.tar.bz2
cse.c (find_comparison_args): Check that we can reverse a comparison if needed before accepting the substitution.
* cse.c (find_comparison_args): Check that we can reverse a comparison if needed before accepting the substitution. From-SVN: r37064
Diffstat (limited to 'gcc/cse.c')
-rw-r--r--gcc/cse.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/cse.c b/gcc/cse.c
index ac9ae6b..17d35ce 100644
--- 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);