diff options
author | Roger Sayle <roger@eyesopen.com> | 2003-10-11 21:00:51 +0000 |
---|---|---|
committer | Roger Sayle <sayle@gcc.gnu.org> | 2003-10-11 21:00:51 +0000 |
commit | e3be1116138b7a387420d370e9f6fddcc395f283 (patch) | |
tree | f822aaf60ebe6f78e03eaac4a15d38c198d39d8c /gcc/expr.c | |
parent | 69efc31da2d437bce7aca9f6bf003a901619359c (diff) | |
download | gcc-e3be1116138b7a387420d370e9f6fddcc395f283.zip gcc-e3be1116138b7a387420d370e9f6fddcc395f283.tar.gz gcc-e3be1116138b7a387420d370e9f6fddcc395f283.tar.bz2 |
expr.c (expand_expr <PLUS_EXPR>): Let expand_operands call safe_from_p for us, once it chooses an evaluation order.
* expr.c (expand_expr <PLUS_EXPR>): Let expand_operands call
safe_from_p for us, once it chooses an evaluation order.
(expand_expr <MULT_EXPR>): Likewise.
(expand_expr <MIN_EXPR> <MAX_EXPR>): Likewise. If expand_operands
places the second operand in "target", swap the operands.
(do_store_flag): Let expand_operands call safe_from_p for us.
* gcc.c-torture/execute/20031011-1.c: New testcase.
From-SVN: r72376
Diffstat (limited to 'gcc/expr.c')
-rw-r--r-- | gcc/expr.c | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -7775,9 +7775,6 @@ expand_expr (tree exp, rtx target, enum machine_mode tmode, } } - if (! safe_from_p (subtarget, TREE_OPERAND (exp, 1), 1)) - subtarget = 0; - /* No sense saving up arithmetic to be done if it's all in the wrong mode to form part of an address. And force_operand won't know whether to sign-extend or @@ -7885,9 +7882,6 @@ expand_expr (tree exp, rtx target, enum machine_mode tmode, TYPE_MODE (TREE_TYPE (exp1)))); } - if (! safe_from_p (subtarget, TREE_OPERAND (exp, 1), 1)) - subtarget = 0; - if (modifier == EXPAND_STACK_PARM) target = 0; @@ -8066,7 +8060,6 @@ expand_expr (tree exp, rtx target, enum machine_mode tmode, target = original_target; if (target == 0 || modifier == EXPAND_STACK_PARM - || ! safe_from_p (target, TREE_OPERAND (exp, 1), 1) || (GET_CODE (target) == MEM && MEM_VOLATILE_P (target)) || GET_MODE (target) != mode || (GET_CODE (target) == REG @@ -8093,6 +8086,14 @@ expand_expr (tree exp, rtx target, enum machine_mode tmode, if (GET_CODE (target) == MEM) target = gen_reg_rtx (mode); + /* If op1 was placed in target, swap op0 and op1. */ + if (target != op0 && target == op1) + { + rtx tem = op0; + op0 = op1; + op1 = tem; + } + if (target != op0) emit_move_insn (target, op0); @@ -9589,8 +9590,7 @@ do_store_flag (tree exp, rtx target, enum machine_mode mode, int only_cheap) } if (! get_subtarget (target) - || GET_MODE (subtarget) != operand_mode - || ! safe_from_p (subtarget, arg1, 1)) + || GET_MODE (subtarget) != operand_mode) subtarget = 0; expand_operands (arg0, arg1, subtarget, &op0, &op1, 0); |