diff options
author | Ulrich Weigand <uweigand@de.ibm.com> | 2005-08-16 02:01:27 +0000 |
---|---|---|
committer | Ulrich Weigand <uweigand@gcc.gnu.org> | 2005-08-16 02:01:27 +0000 |
commit | 5b5dc475889df0f4a8dfcdd6e73d4099a32ce7cc (patch) | |
tree | d52536bec4c05305394b57881adc3110a3ce1cc5 | |
parent | 4e5c1f10352206a66cc058fb638cc766fb867840 (diff) | |
download | gcc-5b5dc475889df0f4a8dfcdd6e73d4099a32ce7cc.zip gcc-5b5dc475889df0f4a8dfcdd6e73d4099a32ce7cc.tar.gz gcc-5b5dc475889df0f4a8dfcdd6e73d4099a32ce7cc.tar.bz2 |
simplify-rtx.c (simplify_const_relational_operation): When extracting arguments of a COMPARE, recompute the mode as well.
* simplify-rtx.c (simplify_const_relational_operation): When
extracting arguments of a COMPARE, recompute the mode as well.
From-SVN: r103143
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/simplify-rtx.c | 12 |
2 files changed, 16 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 50148e2..f4960d60 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2005-08-15 Ulrich Weigand <uweigand@de.ibm.com> + + * simplify-rtx.c (simplify_const_relational_operation): When + extracting arguments of a COMPARE, recompute the mode as well. + 2005-08-15 Ian Lance Taylor <ian@airs.com> * tree.c (build_string): Mark tree CONSTANT and INVARIANT. diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c index e3e2999..ca9d9da 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. */ |