diff options
author | Roger Sayle <roger@eyesopen.com> | 2002-06-15 20:21:22 +0000 |
---|---|---|
committer | Roger Sayle <sayle@gcc.gnu.org> | 2002-06-15 20:21:22 +0000 |
commit | 129e0ee875fbde69fd5bef74a99247b6dfd7b36c (patch) | |
tree | a7b0af58916c32e9d0a0970b6cb38fdfc45107df /gcc/expr.c | |
parent | 3e1b181a6785c3b77b1cd877a8f6759efad6cfe8 (diff) | |
download | gcc-129e0ee875fbde69fd5bef74a99247b6dfd7b36c.tar.gz |
expr.c (compare_from_rtx): Call simplify_relational_operation on all comparisons...
* expr.c (compare_from_rtx): Call simplify_relational_operation
on all comparisons, not just those between integer constants,
with the correct (possibly unsigned) comparison code.
(do_compare_rtx_and_jump): Likewise.
From-SVN: r54657
Diffstat (limited to 'gcc/expr.c')
-rw-r--r-- | gcc/expr.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/gcc/expr.c b/gcc/expr.c index dc36708952d..bba785ab33b 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -10045,6 +10045,7 @@ compare_from_rtx (op0, op1, code, unsignedp, mode, size) enum machine_mode mode; rtx size; { + enum rtx_code ucode; rtx tem; /* If one operand is constant, make it the second one. Only do this @@ -10066,8 +10067,8 @@ compare_from_rtx (op0, op1, code, unsignedp, mode, size) do_pending_stack_adjust (); - if (GET_CODE (op0) == CONST_INT && GET_CODE (op1) == CONST_INT - && (tem = simplify_relational_operation (code, mode, op0, op1)) != 0) + ucode = unsignedp ? unsigned_condition (code) : code; + if ((tem = simplify_relational_operation (ucode, mode, op0, op1)) != 0) return tem; #if 0 @@ -10117,6 +10118,7 @@ do_compare_rtx_and_jump (op0, op1, code, unsignedp, mode, size, rtx size; rtx if_false_label, if_true_label; { + enum rtx_code ucode; rtx tem; int dummy_true_label = 0; @@ -10148,8 +10150,8 @@ do_compare_rtx_and_jump (op0, op1, code, unsignedp, mode, size, do_pending_stack_adjust (); - if (GET_CODE (op0) == CONST_INT && GET_CODE (op1) == CONST_INT - && (tem = simplify_relational_operation (code, mode, op0, op1)) != 0) + ucode = unsignedp ? unsigned_condition (code) : code; + if ((tem = simplify_relational_operation (ucode, mode, op0, op1)) != 0) { if (tem == const_true_rtx) { |