diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1bfbdfa17f1..10f00cb9d6c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2000-12-20 Bernd Schmidt + + * flow.c (ior_reg_cond, and_reg_cond, elim_reg_cond): Properly + handle all relational operators. + 2000-12-20 Alexandre Oliva * final.c (output_addr_const): Use ASM_OUTPUT_SYMBOL_REF. diff --git a/gcc/flow.c b/gcc/flow.c index 725f63fc821..ae98448f44c 100644 --- a/gcc/flow.c +++ b/gcc/flow.c @@ -5010,6 +5010,20 @@ ior_reg_cond (old, x, add) { rtx op0, op1; + if (GET_RTX_CLASS (GET_CODE (old)) == '<') + { + if (GET_RTX_CLASS (GET_CODE (x)) == '<' + && GET_CODE (x) == reverse_condition (GET_CODE (old)) + && REGNO (XEXP (x, 0)) == REGNO (XEXP (old, 0))) + return const1_rtx; + if (GET_CODE (x) == GET_CODE (old) + && REGNO (XEXP (x, 0)) == REGNO (XEXP (old, 0))) + return old; + if (! add) + return old; + return gen_rtx_IOR (0, old, x); + } + switch (GET_CODE (old)) { case IOR: @@ -5062,19 +5076,6 @@ ior_reg_cond (old, x, add) return old; return gen_rtx_IOR (0, old, x); - case EQ: - case NE: - if ((GET_CODE (x) == EQ || GET_CODE (x) == NE) - && GET_CODE (x) != GET_CODE (old) - && REGNO (XEXP (x, 0)) == REGNO (XEXP (old, 0))) - return const1_rtx; - if (GET_CODE (x) == GET_CODE (old) - && REGNO (XEXP (x, 0)) == REGNO (XEXP (old, 0))) - return old; - if (! add) - return old; - return gen_rtx_IOR (0, old, x); - default: abort (); } @@ -5112,6 +5113,20 @@ and_reg_cond (old, x, add) { rtx op0, op1; + if (GET_RTX_CLASS (GET_CODE (old)) == '<') + { + if (GET_RTX_CLASS (GET_CODE (x)) == '<' + && GET_CODE (x) == reverse_condition (GET_CODE (old)) + && REGNO (XEXP (x, 0)) == REGNO (XEXP (old, 0))) + return const0_rtx; + if (GET_CODE (x) == GET_CODE (old) + && REGNO (XEXP (x, 0)) == REGNO (XEXP (old, 0))) + return old; + if (! add) + return old; + return gen_rtx_AND (0, old, x); + } + switch (GET_CODE (old)) { case IOR: @@ -5164,19 +5179,6 @@ and_reg_cond (old, x, add) return old; return gen_rtx_AND (0, old, x); - case EQ: - case NE: - if ((GET_CODE (x) == EQ || GET_CODE (x) == NE) - && GET_CODE (x) != GET_CODE (old) - && REGNO (XEXP (x, 0)) == REGNO (XEXP (old, 0))) - return const0_rtx; - if (GET_CODE (x) == GET_CODE (old) - && REGNO (XEXP (x, 0)) == REGNO (XEXP (old, 0))) - return old; - if (! add) - return old; - return gen_rtx_AND (0, old, x); - default: abort (); } @@ -5193,6 +5195,14 @@ elim_reg_cond (x, regno) unsigned int regno; { rtx op0, op1; + + if (GET_RTX_CLASS (GET_CODE (x)) == '<') + { + if (REGNO (XEXP (x, 0)) == regno) + return const0_rtx; + return x; + } + switch (GET_CODE (x)) { case AND: @@ -5231,11 +5241,6 @@ elim_reg_cond (x, regno) return not_reg_cond (op0); return x; - case EQ: - case NE: - if (REGNO (XEXP (x, 0)) == regno) - return const0_rtx; - return x; default: abort (); }