From a6d172351baf937eb1c5d59f03bf375826d2ea2f Mon Sep 17 00:00:00 2001 From: uweigand Date: Tue, 16 Aug 2005 02:01:27 +0000 Subject: [PATCH] * simplify-rtx.c (simplify_const_relational_operation): When extracting arguments of a COMPARE, recompute the mode as well. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@103143 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 5 +++++ gcc/simplify-rtx.c | 12 +++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 50148e205d0..f4960d60a2f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2005-08-15 Ulrich Weigand + + * simplify-rtx.c (simplify_const_relational_operation): When + extracting arguments of a COMPARE, recompute the mode as well. + 2005-08-15 Ian Lance Taylor * tree.c (build_string): Mark tree CONSTANT and INVARIANT. diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c index e3e29991af8..ca9d9dab4a5 100644 --- a/gcc/simplify-rtx.c +++ b/gcc/simplify-rtx.c @@ -3014,7 +3014,17 @@ simplify_const_relational_operation (enum rtx_code code, /* If op0 is a compare, extract the comparison arguments from it. */ if (GET_CODE (op0) == COMPARE && op1 == const0_rtx) - op1 = XEXP (op0, 1), op0 = XEXP (op0, 0); + { + op1 = XEXP (op0, 1); + op0 = XEXP (op0, 0); + + if (GET_MODE (op0) != VOIDmode) + mode = GET_MODE (op0); + else if (GET_MODE (op1) != VOIDmode) + mode = GET_MODE (op1); + else + return 0; + } /* We can't simplify MODE_CC values since we don't know what the actual comparison is. */ -- 2.11.4.GIT