From c9212f333ae38c52c16184bb00e8af622d88901b Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Sat, 24 Feb 2001 03:18:38 +0100 Subject: [PATCH] * loop.c (canonicalize_condition): Move to reversed_comparison_code. From-SVN: r40019 --- gcc/ChangeLog | 4 ++++ gcc/loop.c | 36 +++++++++++++----------------------- 2 files changed, 17 insertions(+), 23 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7bb6f8c1536..15881bdc9bc 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +Sat Feb 24 03:17:09 CET 2001 Jan Hubicka + + * loop.c (canonicalize_condition): Move to reversed_comparison_code. + 2001-02-21 DJ Delorie * config/i960/i960.h (FRAME_POINTER_REQUIRED): Revert removal of diff --git a/gcc/loop.c b/gcc/loop.c index eee79a31ae5..252e27eb087 100644 --- a/gcc/loop.c +++ b/gcc/loop.c @@ -8305,7 +8305,6 @@ canonicalize_condition (insn, cond, reverse, earliest, want_reg) rtx tem; rtx op0, op1; int reverse_code = 0; - int did_reverse_condition = 0; enum machine_mode mode; code = GET_CODE (cond); @@ -8314,10 +8313,9 @@ canonicalize_condition (insn, cond, reverse, earliest, want_reg) op1 = XEXP (cond, 1); if (reverse) - { - code = reverse_condition (code); - did_reverse_condition ^= 1; - } + code = reversed_comparison_code (cond, insn); + if (code == UNKNOWN) + return 0; if (earliest) *earliest = insn; @@ -8368,13 +8366,19 @@ canonicalize_condition (insn, cond, reverse, earliest, want_reg) if ((prev = prev_nonnote_insn (prev)) == 0 || GET_CODE (prev) != INSN - || FIND_REG_INC_NOTE (prev, 0) - || (set = single_set (prev)) == 0) + || FIND_REG_INC_NOTE (prev, 0)) + break; + + set = set_of (op0, prev); + + if (set + && (GET_CODE (set) != SET + || !rtx_equal_p (SET_DEST (set), op0))) break; /* If this is setting OP0, get what it sets it to if it looks relevant. */ - if (rtx_equal_p (SET_DEST (set), op0)) + if (set) { enum machine_mode inner_mode = GET_MODE (SET_DEST (set)); @@ -8434,10 +8438,6 @@ canonicalize_condition (insn, cond, reverse, earliest, want_reg) || mode == VOIDmode || inner_mode == VOIDmode)) { - /* We might have reversed a LT to get a GE here. But this wasn't - actually the comparison of data, so we don't flag that we - have had to reverse the condition. */ - did_reverse_condition ^= 1; reverse_code = 1; x = SET_SRC (set); } @@ -8455,10 +8455,9 @@ canonicalize_condition (insn, cond, reverse, earliest, want_reg) code = GET_CODE (x); if (reverse_code) { - code = reverse_condition (code); + code = reversed_comparison_code (x, prev); if (code == UNKNOWN) return 0; - did_reverse_condition ^= 1; reverse_code = 0; } @@ -8521,15 +8520,6 @@ canonicalize_condition (insn, cond, reverse, earliest, want_reg) } } - /* If this was floating-point and we reversed anything other than an - EQ or NE or (UN)ORDERED, return zero. */ - if (TARGET_FLOAT_FORMAT == IEEE_FLOAT_FORMAT - && did_reverse_condition - && code != NE && code != EQ && code != UNORDERED && code != ORDERED - && ! flag_fast_math - && GET_MODE_CLASS (GET_MODE (op0)) == MODE_FLOAT) - return 0; - #ifdef HAVE_cc0 /* Never return CC0; return zero instead. */ if (op0 == cc0_rtx) -- 2.30.2