From: Richard Henderson Date: Thu, 26 Oct 2000 00:17:53 +0000 (-0700) Subject: cse.c (find_comparison_args): Check that we can reverse a comparison if needed before... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=78192b0984feaab04d373d0754d06d8a7cd623f3;p=gcc.git 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 03aa3176d48..3edb9b2bff5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2000-10-25 Richard Henderson + + * cse.c (find_comparison_args): Check that we can reverse a + comparison if needed before accepting the substitution. + 2000-10-25 Richard Henderson * reload.c (find_reloads_address_part): Kill rtx obstack hackery. diff --git a/gcc/cse.c b/gcc/cse.c index ac9ae6be46c..17d35ceff76 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);