aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1993-01-27 19:22:17 -0500
committerRichard Kenner <kenner@gcc.gnu.org>1993-01-27 19:22:17 -0500
commitbf743ac5ed9fc641a83dc52fd0e7f099518aa647 (patch)
tree2b5c7ad54ea13220edfae3d661ef421c23629146
parentc81fe25de970cfe3e5570df9bfb5625660e723df (diff)
downloadgcc-bf743ac5ed9fc641a83dc52fd0e7f099518aa647.zip
gcc-bf743ac5ed9fc641a83dc52fd0e7f099518aa647.tar.gz
gcc-bf743ac5ed9fc641a83dc52fd0e7f099518aa647.tar.bz2
(compare_from_rtx): Only swap operand if first is a constant and
second is not. From-SVN: r3370
-rw-r--r--gcc/expr.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 1a3cd5b..6b4a57a 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -7116,9 +7116,11 @@ compare_from_rtx (op0, op1, code, unsignedp, mode, size, align)
{
rtx tem;
- /* If one operand is constant, make it the second one. */
+ /* If one operand is constant, make it the second one. Only do this
+ if the other operand is not constant as well. */
- if (GET_CODE (op0) == CONST_INT || GET_CODE (op0) == CONST_DOUBLE)
+ if ((CONSTANT_P (op0) && ! CONSTANT_P (op1))
+ || (GET_CODE (op0) == CONST_INT && GET_CODE (op1) != CONST_INT))
{
tem = op0;
op0 = op1;