Commit b32e7cdb by Michael Matz Committed by Michael Matz

expr.c (expand_expr_real_1): New local treeop0...

        * expr.c (expand_expr_real_1): New local treeop0, treeop1,
        treeop2 initialized with first three operands of the full expression.
        Substitute all TREE_OPERAND (exp, [012]) calls with them.

From-SVN: r151078
parent ce4a9de3
2009-08-25 Michael Matz <matz@suse.de>
* expr.c (expand_expr_real_1): New local treeop0, treeop1,
treeop2 initialized with first three operands of the full expression.
Substitute all TREE_OPERAND (exp, [012]) calls with them.
2009-08-25 Kai Tietz <kai.tietz@onevision.com> 2009-08-25 Kai Tietz <kai.tietz@onevision.com>
* gcc/gthr-win32.h (__UNUSED_PARAM): Define, if not already present. * gcc/gthr-win32.h (__UNUSED_PARAM): Define, if not already present.
......
...@@ -7220,6 +7220,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -7220,6 +7220,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
gimple subexp0_def, subexp1_def; gimple subexp0_def, subexp1_def;
tree top0, top1; tree top0, top1;
location_t loc = EXPR_LOCATION (exp); location_t loc = EXPR_LOCATION (exp);
tree treeop0, treeop1, treeop2;
#define REDUCE_BIT_FIELD(expr) (reduce_bit_field \ #define REDUCE_BIT_FIELD(expr) (reduce_bit_field \
? reduce_to_bit_field_precision ((expr), \ ? reduce_to_bit_field_precision ((expr), \
target, \ target, \
...@@ -7230,6 +7231,17 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -7230,6 +7231,17 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
mode = TYPE_MODE (type); mode = TYPE_MODE (type);
unsignedp = TYPE_UNSIGNED (type); unsignedp = TYPE_UNSIGNED (type);
treeop0 = treeop1 = treeop2 = NULL_TREE;
if (!VL_EXP_CLASS_P (exp))
switch (TREE_CODE_LENGTH (code))
{
default:
case 3: treeop2 = TREE_OPERAND (exp, 2);
case 2: treeop1 = TREE_OPERAND (exp, 1);
case 1: treeop0 = TREE_OPERAND (exp, 0);
case 0: break;
}
ignore = (target == const0_rtx ignore = (target == const0_rtx
|| ((CONVERT_EXPR_CODE_P (code) || ((CONVERT_EXPR_CODE_P (code)
|| code == COND_EXPR || code == VIEW_CONVERT_EXPR) || code == COND_EXPR || code == VIEW_CONVERT_EXPR)
...@@ -7268,22 +7280,22 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -7268,22 +7280,22 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
if (TREE_CODE_CLASS (code) == tcc_unary if (TREE_CODE_CLASS (code) == tcc_unary
|| code == COMPONENT_REF || code == INDIRECT_REF) || code == COMPONENT_REF || code == INDIRECT_REF)
return expand_expr (TREE_OPERAND (exp, 0), const0_rtx, VOIDmode, return expand_expr (treeop0, const0_rtx, VOIDmode,
modifier); modifier);
else if (TREE_CODE_CLASS (code) == tcc_binary else if (TREE_CODE_CLASS (code) == tcc_binary
|| TREE_CODE_CLASS (code) == tcc_comparison || TREE_CODE_CLASS (code) == tcc_comparison
|| code == ARRAY_REF || code == ARRAY_RANGE_REF) || code == ARRAY_REF || code == ARRAY_RANGE_REF)
{ {
expand_expr (TREE_OPERAND (exp, 0), const0_rtx, VOIDmode, modifier); expand_expr (treeop0, const0_rtx, VOIDmode, modifier);
expand_expr (TREE_OPERAND (exp, 1), const0_rtx, VOIDmode, modifier); expand_expr (treeop1, const0_rtx, VOIDmode, modifier);
return const0_rtx; return const0_rtx;
} }
else if (code == BIT_FIELD_REF) else if (code == BIT_FIELD_REF)
{ {
expand_expr (TREE_OPERAND (exp, 0), const0_rtx, VOIDmode, modifier); expand_expr (treeop0, const0_rtx, VOIDmode, modifier);
expand_expr (TREE_OPERAND (exp, 1), const0_rtx, VOIDmode, modifier); expand_expr (treeop1, const0_rtx, VOIDmode, modifier);
expand_expr (TREE_OPERAND (exp, 2), const0_rtx, VOIDmode, modifier); expand_expr (treeop2, const0_rtx, VOIDmode, modifier);
return const0_rtx; return const0_rtx;
} }
...@@ -7524,7 +7536,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -7524,7 +7536,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
case SAVE_EXPR: case SAVE_EXPR:
{ {
tree val = TREE_OPERAND (exp, 0); tree val = treeop0;
rtx ret = expand_expr_real_1 (val, target, tmode, modifier, alt_rtl); rtx ret = expand_expr_real_1 (val, target, tmode, modifier, alt_rtl);
if (!SAVE_EXPR_RESOLVED_P (exp)) if (!SAVE_EXPR_RESOLVED_P (exp))
...@@ -7539,7 +7551,8 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -7539,7 +7551,8 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
VAR_DECL, NULL, TREE_TYPE (exp)); VAR_DECL, NULL, TREE_TYPE (exp));
DECL_ARTIFICIAL (val) = 1; DECL_ARTIFICIAL (val) = 1;
DECL_IGNORED_P (val) = 1; DECL_IGNORED_P (val) = 1;
TREE_OPERAND (exp, 0) = val; treeop0 = val;
TREE_OPERAND (exp, 0) = treeop0;
SAVE_EXPR_RESOLVED_P (exp) = 1; SAVE_EXPR_RESOLVED_P (exp) = 1;
if (!CONSTANT_P (ret)) if (!CONSTANT_P (ret))
...@@ -7551,10 +7564,10 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -7551,10 +7564,10 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
} }
case GOTO_EXPR: case GOTO_EXPR:
if (TREE_CODE (TREE_OPERAND (exp, 0)) == LABEL_DECL) if (TREE_CODE (treeop0) == LABEL_DECL)
expand_goto (TREE_OPERAND (exp, 0)); expand_goto (treeop0);
else else
expand_computed_goto (TREE_OPERAND (exp, 0)); expand_computed_goto (treeop0);
return const0_rtx; return const0_rtx;
case CONSTRUCTOR: case CONSTRUCTOR:
...@@ -7577,7 +7590,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -7577,7 +7590,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
case ALIGN_INDIRECT_REF: case ALIGN_INDIRECT_REF:
case INDIRECT_REF: case INDIRECT_REF:
{ {
tree exp1 = TREE_OPERAND (exp, 0); tree exp1 = treeop0;
if (modifier != EXPAND_WRITE) if (modifier != EXPAND_WRITE)
{ {
...@@ -7645,8 +7658,8 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -7645,8 +7658,8 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
case ARRAY_REF: case ARRAY_REF:
{ {
tree array = TREE_OPERAND (exp, 0); tree array = treeop0;
tree index = TREE_OPERAND (exp, 1); tree index = treeop1;
/* Fold an expression like: "foo"[2]. /* Fold an expression like: "foo"[2].
This is not done in fold so it won't happen inside &. This is not done in fold so it won't happen inside &.
...@@ -7736,7 +7749,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -7736,7 +7749,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
tree index1 = index; tree index1 = index;
tree low_bound = array_ref_low_bound (exp); tree low_bound = array_ref_low_bound (exp);
index1 = fold_convert_loc (loc, sizetype, index1 = fold_convert_loc (loc, sizetype,
TREE_OPERAND (exp, 1)); treeop1);
/* Optimize the special-case of a zero lower bound. /* Optimize the special-case of a zero lower bound.
...@@ -7772,14 +7785,14 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -7772,14 +7785,14 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
case COMPONENT_REF: case COMPONENT_REF:
/* If the operand is a CONSTRUCTOR, we can just extract the /* If the operand is a CONSTRUCTOR, we can just extract the
appropriate field if it is present. */ appropriate field if it is present. */
if (TREE_CODE (TREE_OPERAND (exp, 0)) == CONSTRUCTOR) if (TREE_CODE (treeop0) == CONSTRUCTOR)
{ {
unsigned HOST_WIDE_INT idx; unsigned HOST_WIDE_INT idx;
tree field, value; tree field, value;
FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (TREE_OPERAND (exp, 0)), FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (treeop0),
idx, field, value) idx, field, value)
if (field == TREE_OPERAND (exp, 1) if (field == treeop1
/* We can normally use the value of the field in the /* We can normally use the value of the field in the
CONSTRUCTOR. However, if this is a bitfield in CONSTRUCTOR. However, if this is a bitfield in
an integral mode that we can fit in a HOST_WIDE_INT, an integral mode that we can fit in a HOST_WIDE_INT,
...@@ -8159,18 +8172,18 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -8159,18 +8172,18 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
case PAREN_EXPR: case PAREN_EXPR:
CASE_CONVERT: CASE_CONVERT:
if (TREE_OPERAND (exp, 0) == error_mark_node) if (treeop0 == error_mark_node)
return const0_rtx; return const0_rtx;
if (TREE_CODE (type) == UNION_TYPE) if (TREE_CODE (type) == UNION_TYPE)
{ {
tree valtype = TREE_TYPE (TREE_OPERAND (exp, 0)); tree valtype = TREE_TYPE (treeop0);
/* If both input and output are BLKmode, this conversion isn't doing /* If both input and output are BLKmode, this conversion isn't doing
anything except possibly changing memory attribute. */ anything except possibly changing memory attribute. */
if (mode == BLKmode && TYPE_MODE (valtype) == BLKmode) if (mode == BLKmode && TYPE_MODE (valtype) == BLKmode)
{ {
rtx result = expand_expr (TREE_OPERAND (exp, 0), target, tmode, rtx result = expand_expr (treeop0, target, tmode,
modifier); modifier);
result = copy_rtx (result); result = copy_rtx (result);
...@@ -8188,7 +8201,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -8188,7 +8201,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
if (MEM_P (target)) if (MEM_P (target))
/* Store data into beginning of memory target. */ /* Store data into beginning of memory target. */
store_expr (TREE_OPERAND (exp, 0), store_expr (treeop0,
adjust_address (target, TYPE_MODE (valtype), 0), adjust_address (target, TYPE_MODE (valtype), 0),
modifier == EXPAND_STACK_PARM, modifier == EXPAND_STACK_PARM,
false); false);
...@@ -8200,10 +8213,10 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -8200,10 +8213,10 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
/* Store this field into a union of the proper type. */ /* Store this field into a union of the proper type. */
store_field (target, store_field (target,
MIN ((int_size_in_bytes (TREE_TYPE MIN ((int_size_in_bytes (TREE_TYPE
(TREE_OPERAND (exp, 0))) (treeop0))
* BITS_PER_UNIT), * BITS_PER_UNIT),
(HOST_WIDE_INT) GET_MODE_BITSIZE (mode)), (HOST_WIDE_INT) GET_MODE_BITSIZE (mode)),
0, TYPE_MODE (valtype), TREE_OPERAND (exp, 0), 0, TYPE_MODE (valtype), treeop0,
type, 0, false); type, 0, false);
} }
...@@ -8211,22 +8224,22 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -8211,22 +8224,22 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
return target; return target;
} }
if (mode == TYPE_MODE (TREE_TYPE (TREE_OPERAND (exp, 0)))) if (mode == TYPE_MODE (TREE_TYPE (treeop0)))
{ {
op0 = expand_expr (TREE_OPERAND (exp, 0), target, VOIDmode, op0 = expand_expr (treeop0, target, VOIDmode,
modifier); modifier);
/* If the signedness of the conversion differs and OP0 is /* If the signedness of the conversion differs and OP0 is
a promoted SUBREG, clear that indication since we now a promoted SUBREG, clear that indication since we now
have to do the proper extension. */ have to do the proper extension. */
if (TYPE_UNSIGNED (TREE_TYPE (TREE_OPERAND (exp, 0))) != unsignedp if (TYPE_UNSIGNED (TREE_TYPE (treeop0)) != unsignedp
&& GET_CODE (op0) == SUBREG) && GET_CODE (op0) == SUBREG)
SUBREG_PROMOTED_VAR_P (op0) = 0; SUBREG_PROMOTED_VAR_P (op0) = 0;
return REDUCE_BIT_FIELD (op0); return REDUCE_BIT_FIELD (op0);
} }
op0 = expand_expr (TREE_OPERAND (exp, 0), NULL_RTX, mode, op0 = expand_expr (treeop0, NULL_RTX, mode,
modifier == EXPAND_SUM ? EXPAND_NORMAL : modifier); modifier == EXPAND_SUM ? EXPAND_NORMAL : modifier);
if (GET_MODE (op0) == mode) if (GET_MODE (op0) == mode)
; ;
...@@ -8234,7 +8247,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -8234,7 +8247,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
/* If OP0 is a constant, just convert it into the proper mode. */ /* If OP0 is a constant, just convert it into the proper mode. */
else if (CONSTANT_P (op0)) else if (CONSTANT_P (op0))
{ {
tree inner_type = TREE_TYPE (TREE_OPERAND (exp, 0)); tree inner_type = TREE_TYPE (treeop0);
enum machine_mode inner_mode = TYPE_MODE (inner_type); enum machine_mode inner_mode = TYPE_MODE (inner_type);
if (modifier == EXPAND_INITIALIZER) if (modifier == EXPAND_INITIALIZER)
...@@ -8252,11 +8265,11 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -8252,11 +8265,11 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
else if (target == 0) else if (target == 0)
op0 = convert_to_mode (mode, op0, op0 = convert_to_mode (mode, op0,
TYPE_UNSIGNED (TREE_TYPE TYPE_UNSIGNED (TREE_TYPE
(TREE_OPERAND (exp, 0)))); (treeop0)));
else else
{ {
convert_move (target, op0, convert_move (target, op0,
TYPE_UNSIGNED (TREE_TYPE (TREE_OPERAND (exp, 0)))); TYPE_UNSIGNED (TREE_TYPE (treeop0)));
op0 = target; op0 = target;
} }
...@@ -8269,8 +8282,8 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -8269,8 +8282,8 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
temporary by fetching an inner memory reference. */ temporary by fetching an inner memory reference. */
if (mode == BLKmode if (mode == BLKmode
&& TREE_CODE (TYPE_SIZE (TREE_TYPE (exp))) == INTEGER_CST && TREE_CODE (TYPE_SIZE (TREE_TYPE (exp))) == INTEGER_CST
&& TYPE_MODE (TREE_TYPE (TREE_OPERAND (exp, 0))) != BLKmode && TYPE_MODE (TREE_TYPE (treeop0)) != BLKmode
&& handled_component_p (TREE_OPERAND (exp, 0))) && handled_component_p (treeop0))
{ {
enum machine_mode mode1; enum machine_mode mode1;
HOST_WIDE_INT bitsize, bitpos; HOST_WIDE_INT bitsize, bitpos;
...@@ -8278,7 +8291,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -8278,7 +8291,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
int unsignedp; int unsignedp;
int volatilep = 0; int volatilep = 0;
tree tem tree tem
= get_inner_reference (TREE_OPERAND (exp, 0), &bitsize, &bitpos, = get_inner_reference (treeop0, &bitsize, &bitpos,
&offset, &mode1, &unsignedp, &volatilep, &offset, &mode1, &unsignedp, &volatilep,
true); true);
rtx orig_op0; rtx orig_op0;
...@@ -8318,7 +8331,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -8318,7 +8331,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
if (op0 == orig_op0) if (op0 == orig_op0)
op0 = copy_rtx (op0); op0 = copy_rtx (op0);
set_mem_attributes (op0, TREE_OPERAND (exp, 0), 0); set_mem_attributes (op0, treeop0, 0);
if (REG_P (XEXP (op0, 0))) if (REG_P (XEXP (op0, 0)))
mark_reg_pointer (XEXP (op0, 0), MEM_ALIGN (op0)); mark_reg_pointer (XEXP (op0, 0), MEM_ALIGN (op0));
...@@ -8328,7 +8341,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -8328,7 +8341,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
} }
if (!op0) if (!op0)
op0 = expand_expr (TREE_OPERAND (exp, 0), op0 = expand_expr (treeop0,
NULL_RTX, VOIDmode, modifier); NULL_RTX, VOIDmode, modifier);
/* If the input and output modes are both the same, we are done. */ /* If the input and output modes are both the same, we are done. */
...@@ -8348,7 +8361,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -8348,7 +8361,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
other. */ other. */
else if (SCALAR_INT_MODE_P (GET_MODE (op0)) && SCALAR_INT_MODE_P (mode)) else if (SCALAR_INT_MODE_P (GET_MODE (op0)) && SCALAR_INT_MODE_P (mode))
op0 = convert_modes (mode, GET_MODE (op0), op0, op0 = convert_modes (mode, GET_MODE (op0), op0,
TYPE_UNSIGNED (TREE_TYPE (TREE_OPERAND (exp, 0)))); TYPE_UNSIGNED (TREE_TYPE (treeop0)));
/* As a last resort, spill op0 to memory, and reload it in a /* As a last resort, spill op0 to memory, and reload it in a
different mode. */ different mode. */
else if (!MEM_P (op0)) else if (!MEM_P (op0))
...@@ -8357,7 +8370,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -8357,7 +8370,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
are going to be changing the mode of the MEM, don't call are going to be changing the mode of the MEM, don't call
force_const_mem for constants because we don't allow pool force_const_mem for constants because we don't allow pool
constants to change mode. */ constants to change mode. */
tree inner_type = TREE_TYPE (TREE_OPERAND (exp, 0)); tree inner_type = TREE_TYPE (treeop0);
gcc_assert (!TREE_ADDRESSABLE (exp)); gcc_assert (!TREE_ADDRESSABLE (exp));
...@@ -8385,7 +8398,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -8385,7 +8398,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
&& mode != BLKmode && mode != BLKmode
&& MEM_ALIGN (op0) < GET_MODE_ALIGNMENT (mode)) && MEM_ALIGN (op0) < GET_MODE_ALIGNMENT (mode))
{ {
tree inner_type = TREE_TYPE (TREE_OPERAND (exp, 0)); tree inner_type = TREE_TYPE (treeop0);
HOST_WIDE_INT temp_size HOST_WIDE_INT temp_size
= MAX (int_size_in_bytes (inner_type), = MAX (int_size_in_bytes (inner_type),
(HOST_WIDE_INT) GET_MODE_SIZE (mode)); (HOST_WIDE_INT) GET_MODE_SIZE (mode));
...@@ -8419,18 +8432,15 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -8419,18 +8432,15 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
/* Make sure to sign-extend the sizetype offset in a POINTER_PLUS_EXPR /* Make sure to sign-extend the sizetype offset in a POINTER_PLUS_EXPR
if sizetype precision is smaller than pointer precision. */ if sizetype precision is smaller than pointer precision. */
if (TYPE_PRECISION (sizetype) < TYPE_PRECISION (type)) if (TYPE_PRECISION (sizetype) < TYPE_PRECISION (type))
exp treeop1 = fold_convert_loc (loc, type,
= build2 (PLUS_EXPR, type,
TREE_OPERAND (exp, 0),
fold_convert_loc (loc, type,
fold_convert_loc (loc, ssizetype, fold_convert_loc (loc, ssizetype,
TREE_OPERAND (exp, 1)))); treeop1));
case PLUS_EXPR: case PLUS_EXPR:
/* Check if this is a case for multiplication and addition. */ /* Check if this is a case for multiplication and addition. */
if ((TREE_CODE (type) == INTEGER_TYPE if ((TREE_CODE (type) == INTEGER_TYPE
|| TREE_CODE (type) == FIXED_POINT_TYPE) || TREE_CODE (type) == FIXED_POINT_TYPE)
&& (subexp0_def = get_def_for_expr (TREE_OPERAND (exp, 0), && (subexp0_def = get_def_for_expr (treeop0,
MULT_EXPR))) MULT_EXPR)))
{ {
tree subsubexp0, subsubexp1; tree subsubexp0, subsubexp1;
...@@ -8468,7 +8478,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -8468,7 +8478,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
{ {
expand_operands (top0, top1, NULL_RTX, &op0, &op1, expand_operands (top0, top1, NULL_RTX, &op0, &op1,
EXPAND_NORMAL); EXPAND_NORMAL);
op2 = expand_expr (TREE_OPERAND (exp, 1), subtarget, op2 = expand_expr (treeop1, subtarget,
VOIDmode, EXPAND_NORMAL); VOIDmode, EXPAND_NORMAL);
temp = expand_ternary_op (mode, this_optab, op0, op1, op2, temp = expand_ternary_op (mode, this_optab, op0, op1, op2,
target, unsignedp); target, unsignedp);
...@@ -8489,17 +8499,17 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -8489,17 +8499,17 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
sp, ap, or fp is our second argument, in which case we must swap sp, ap, or fp is our second argument, in which case we must swap
the innermost first argument and our second argument. */ the innermost first argument and our second argument. */
if (TREE_CODE (TREE_OPERAND (exp, 0)) == PLUS_EXPR if (TREE_CODE (treeop0) == PLUS_EXPR
&& TREE_CODE (TREE_OPERAND (TREE_OPERAND (exp, 0), 1)) == INTEGER_CST && TREE_CODE (TREE_OPERAND (treeop0, 1)) == INTEGER_CST
&& TREE_CODE (TREE_OPERAND (exp, 1)) == VAR_DECL && TREE_CODE (treeop1) == VAR_DECL
&& (DECL_RTL (TREE_OPERAND (exp, 1)) == frame_pointer_rtx && (DECL_RTL (treeop1) == frame_pointer_rtx
|| DECL_RTL (TREE_OPERAND (exp, 1)) == stack_pointer_rtx || DECL_RTL (treeop1) == stack_pointer_rtx
|| DECL_RTL (TREE_OPERAND (exp, 1)) == arg_pointer_rtx)) || DECL_RTL (treeop1) == arg_pointer_rtx))
{ {
tree t = TREE_OPERAND (exp, 1); tree t = treeop1;
TREE_OPERAND (exp, 1) = TREE_OPERAND (TREE_OPERAND (exp, 0), 0); treeop1 = TREE_OPERAND (treeop0, 0);
TREE_OPERAND (TREE_OPERAND (exp, 0), 0) = t; TREE_OPERAND (treeop0, 0) = t;
} }
/* If the result is to be ptr_mode and we are adding an integer to /* If the result is to be ptr_mode and we are adding an integer to
...@@ -8515,40 +8525,40 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -8515,40 +8525,40 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
{ {
if (modifier == EXPAND_STACK_PARM) if (modifier == EXPAND_STACK_PARM)
target = 0; target = 0;
if (TREE_CODE (TREE_OPERAND (exp, 0)) == INTEGER_CST if (TREE_CODE (treeop0) == INTEGER_CST
&& GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT && GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT
&& TREE_CONSTANT (TREE_OPERAND (exp, 1))) && TREE_CONSTANT (treeop1))
{ {
rtx constant_part; rtx constant_part;
op1 = expand_expr (TREE_OPERAND (exp, 1), subtarget, VOIDmode, op1 = expand_expr (treeop1, subtarget, VOIDmode,
EXPAND_SUM); EXPAND_SUM);
/* Use immed_double_const to ensure that the constant is /* Use immed_double_const to ensure that the constant is
truncated according to the mode of OP1, then sign extended truncated according to the mode of OP1, then sign extended
to a HOST_WIDE_INT. Using the constant directly can result to a HOST_WIDE_INT. Using the constant directly can result
in non-canonical RTL in a 64x32 cross compile. */ in non-canonical RTL in a 64x32 cross compile. */
constant_part constant_part
= immed_double_const (TREE_INT_CST_LOW (TREE_OPERAND (exp, 0)), = immed_double_const (TREE_INT_CST_LOW (treeop0),
(HOST_WIDE_INT) 0, (HOST_WIDE_INT) 0,
TYPE_MODE (TREE_TYPE (TREE_OPERAND (exp, 1)))); TYPE_MODE (TREE_TYPE (treeop1)));
op1 = plus_constant (op1, INTVAL (constant_part)); op1 = plus_constant (op1, INTVAL (constant_part));
if (modifier != EXPAND_SUM && modifier != EXPAND_INITIALIZER) if (modifier != EXPAND_SUM && modifier != EXPAND_INITIALIZER)
op1 = force_operand (op1, target); op1 = force_operand (op1, target);
return REDUCE_BIT_FIELD (op1); return REDUCE_BIT_FIELD (op1);
} }
else if (TREE_CODE (TREE_OPERAND (exp, 1)) == INTEGER_CST else if (TREE_CODE (treeop1) == INTEGER_CST
&& GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT && GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT
&& TREE_CONSTANT (TREE_OPERAND (exp, 0))) && TREE_CONSTANT (treeop0))
{ {
rtx constant_part; rtx constant_part;
op0 = expand_expr (TREE_OPERAND (exp, 0), subtarget, VOIDmode, op0 = expand_expr (treeop0, subtarget, VOIDmode,
(modifier == EXPAND_INITIALIZER (modifier == EXPAND_INITIALIZER
? EXPAND_INITIALIZER : EXPAND_SUM)); ? EXPAND_INITIALIZER : EXPAND_SUM));
if (! CONSTANT_P (op0)) if (! CONSTANT_P (op0))
{ {
op1 = expand_expr (TREE_OPERAND (exp, 1), NULL_RTX, op1 = expand_expr (treeop1, NULL_RTX,
VOIDmode, modifier); VOIDmode, modifier);
/* Return a PLUS if modifier says it's OK. */ /* Return a PLUS if modifier says it's OK. */
if (modifier == EXPAND_SUM if (modifier == EXPAND_SUM
...@@ -8561,9 +8571,9 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -8561,9 +8571,9 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
to a HOST_WIDE_INT. Using the constant directly can result to a HOST_WIDE_INT. Using the constant directly can result
in non-canonical RTL in a 64x32 cross compile. */ in non-canonical RTL in a 64x32 cross compile. */
constant_part constant_part
= immed_double_const (TREE_INT_CST_LOW (TREE_OPERAND (exp, 1)), = immed_double_const (TREE_INT_CST_LOW (treeop1),
(HOST_WIDE_INT) 0, (HOST_WIDE_INT) 0,
TYPE_MODE (TREE_TYPE (TREE_OPERAND (exp, 0)))); TYPE_MODE (TREE_TYPE (treeop0)));
op0 = plus_constant (op0, INTVAL (constant_part)); op0 = plus_constant (op0, INTVAL (constant_part));
if (modifier != EXPAND_SUM && modifier != EXPAND_INITIALIZER) if (modifier != EXPAND_SUM && modifier != EXPAND_INITIALIZER)
op0 = force_operand (op0, target); op0 = force_operand (op0, target);
...@@ -8578,7 +8588,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -8578,7 +8588,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
if ((modifier != EXPAND_SUM && modifier != EXPAND_INITIALIZER) if ((modifier != EXPAND_SUM && modifier != EXPAND_INITIALIZER)
|| mode != ptr_mode) || mode != ptr_mode)
{ {
expand_operands (TREE_OPERAND (exp, 0), TREE_OPERAND (exp, 1), expand_operands (treeop0, treeop1,
subtarget, &op0, &op1, EXPAND_NORMAL); subtarget, &op0, &op1, EXPAND_NORMAL);
if (op0 == const0_rtx) if (op0 == const0_rtx)
return op1; return op1;
...@@ -8587,7 +8597,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -8587,7 +8597,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
goto binop2; goto binop2;
} }
expand_operands (TREE_OPERAND (exp, 0), TREE_OPERAND (exp, 1), expand_operands (treeop0, treeop1,
subtarget, &op0, &op1, modifier); subtarget, &op0, &op1, modifier);
return REDUCE_BIT_FIELD (simplify_gen_binary (PLUS, mode, op0, op1)); return REDUCE_BIT_FIELD (simplify_gen_binary (PLUS, mode, op0, op1));
...@@ -8595,7 +8605,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -8595,7 +8605,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
/* Check if this is a case for multiplication and subtraction. */ /* Check if this is a case for multiplication and subtraction. */
if ((TREE_CODE (type) == INTEGER_TYPE if ((TREE_CODE (type) == INTEGER_TYPE
|| TREE_CODE (type) == FIXED_POINT_TYPE) || TREE_CODE (type) == FIXED_POINT_TYPE)
&& (subexp1_def = get_def_for_expr (TREE_OPERAND (exp, 1), && (subexp1_def = get_def_for_expr (treeop1,
MULT_EXPR))) MULT_EXPR)))
{ {
tree subsubexp0, subsubexp1; tree subsubexp0, subsubexp1;
...@@ -8633,7 +8643,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -8633,7 +8643,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
{ {
expand_operands (top0, top1, NULL_RTX, &op0, &op1, expand_operands (top0, top1, NULL_RTX, &op0, &op1,
EXPAND_NORMAL); EXPAND_NORMAL);
op2 = expand_expr (TREE_OPERAND (exp, 0), subtarget, op2 = expand_expr (treeop0, subtarget,
VOIDmode, EXPAND_NORMAL); VOIDmode, EXPAND_NORMAL);
temp = expand_ternary_op (mode, this_optab, op0, op1, op2, temp = expand_ternary_op (mode, this_optab, op0, op1, op2,
target, unsignedp); target, unsignedp);
...@@ -8649,10 +8659,10 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -8649,10 +8659,10 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
/* Handle difference of two symbolic constants, /* Handle difference of two symbolic constants,
for the sake of an initializer. */ for the sake of an initializer. */
if ((modifier == EXPAND_SUM || modifier == EXPAND_INITIALIZER) if ((modifier == EXPAND_SUM || modifier == EXPAND_INITIALIZER)
&& really_constant_p (TREE_OPERAND (exp, 0)) && really_constant_p (treeop0)
&& really_constant_p (TREE_OPERAND (exp, 1))) && really_constant_p (treeop1))
{ {
expand_operands (TREE_OPERAND (exp, 0), TREE_OPERAND (exp, 1), expand_operands (treeop0, treeop1,
NULL_RTX, &op0, &op1, modifier); NULL_RTX, &op0, &op1, modifier);
/* If the last operand is a CONST_INT, use plus_constant of /* If the last operand is a CONST_INT, use plus_constant of
...@@ -8671,7 +8681,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -8671,7 +8681,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
|| mode != ptr_mode) || mode != ptr_mode)
goto binop; goto binop;
expand_operands (TREE_OPERAND (exp, 0), TREE_OPERAND (exp, 1), expand_operands (treeop0, treeop1,
subtarget, &op0, &op1, modifier); subtarget, &op0, &op1, modifier);
/* Convert A - const to A + (-const). */ /* Convert A - const to A + (-const). */
...@@ -8693,22 +8703,22 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -8693,22 +8703,22 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
/* If first operand is constant, swap them. /* If first operand is constant, swap them.
Thus the following special case checks need only Thus the following special case checks need only
check the second operand. */ check the second operand. */
if (TREE_CODE (TREE_OPERAND (exp, 0)) == INTEGER_CST) if (TREE_CODE (treeop0) == INTEGER_CST)
{ {
tree t1 = TREE_OPERAND (exp, 0); tree t1 = treeop0;
TREE_OPERAND (exp, 0) = TREE_OPERAND (exp, 1); treeop0 = treeop1;
TREE_OPERAND (exp, 1) = t1; treeop1 = t1;
} }
/* Attempt to return something suitable for generating an /* Attempt to return something suitable for generating an
indexed address, for machines that support that. */ indexed address, for machines that support that. */
if (modifier == EXPAND_SUM && mode == ptr_mode if (modifier == EXPAND_SUM && mode == ptr_mode
&& host_integerp (TREE_OPERAND (exp, 1), 0)) && host_integerp (treeop1, 0))
{ {
tree exp1 = TREE_OPERAND (exp, 1); tree exp1 = treeop1;
op0 = expand_expr (TREE_OPERAND (exp, 0), subtarget, VOIDmode, op0 = expand_expr (treeop0, subtarget, VOIDmode,
EXPAND_SUM); EXPAND_SUM);
if (!REG_P (op0)) if (!REG_P (op0))
...@@ -8729,8 +8739,8 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -8729,8 +8739,8 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
in that narrower type with a result in the desired type, in that narrower type with a result in the desired type,
do it that way, and avoid the explicit type-conversion. */ do it that way, and avoid the explicit type-conversion. */
subexp0 = TREE_OPERAND (exp, 0); subexp0 = treeop0;
subexp1 = TREE_OPERAND (exp, 1); subexp1 = treeop1;
subexp0_def = get_def_for_expr (subexp0, NOP_EXPR); subexp0_def = get_def_for_expr (subexp0, NOP_EXPR);
subexp1_def = get_def_for_expr (subexp1, NOP_EXPR); subexp1_def = get_def_for_expr (subexp1, NOP_EXPR);
top0 = top1 = NULL_TREE; top0 = top1 = NULL_TREE;
...@@ -8848,7 +8858,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -8848,7 +8858,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
/* Possible optimization: compute the dividend with EXPAND_SUM /* Possible optimization: compute the dividend with EXPAND_SUM
then if the divisor is constant can optimize the case then if the divisor is constant can optimize the case
where some terms of the dividend have coeffs divisible by it. */ where some terms of the dividend have coeffs divisible by it. */
expand_operands (TREE_OPERAND (exp, 0), TREE_OPERAND (exp, 1), expand_operands (treeop0, treeop1,
subtarget, &op0, &op1, EXPAND_NORMAL); subtarget, &op0, &op1, EXPAND_NORMAL);
return expand_divmod (0, code, mode, op0, op1, target, unsignedp); return expand_divmod (0, code, mode, op0, op1, target, unsignedp);
...@@ -8861,17 +8871,17 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -8861,17 +8871,17 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
case ROUND_MOD_EXPR: case ROUND_MOD_EXPR:
if (modifier == EXPAND_STACK_PARM) if (modifier == EXPAND_STACK_PARM)
target = 0; target = 0;
expand_operands (TREE_OPERAND (exp, 0), TREE_OPERAND (exp, 1), expand_operands (treeop0, treeop1,
subtarget, &op0, &op1, EXPAND_NORMAL); subtarget, &op0, &op1, EXPAND_NORMAL);
return expand_divmod (1, code, mode, op0, op1, target, unsignedp); return expand_divmod (1, code, mode, op0, op1, target, unsignedp);
case FIXED_CONVERT_EXPR: case FIXED_CONVERT_EXPR:
op0 = expand_normal (TREE_OPERAND (exp, 0)); op0 = expand_normal (treeop0);
if (target == 0 || modifier == EXPAND_STACK_PARM) if (target == 0 || modifier == EXPAND_STACK_PARM)
target = gen_reg_rtx (mode); target = gen_reg_rtx (mode);
if ((TREE_CODE (TREE_TYPE (TREE_OPERAND (exp, 0))) == INTEGER_TYPE if ((TREE_CODE (TREE_TYPE (treeop0)) == INTEGER_TYPE
&& TYPE_UNSIGNED (TREE_TYPE (TREE_OPERAND (exp, 0)))) && TYPE_UNSIGNED (TREE_TYPE (treeop0)))
|| (TREE_CODE (type) == INTEGER_TYPE && TYPE_UNSIGNED (type))) || (TREE_CODE (type) == INTEGER_TYPE && TYPE_UNSIGNED (type)))
expand_fixed_convert (target, op0, 1, TYPE_SATURATING (type)); expand_fixed_convert (target, op0, 1, TYPE_SATURATING (type));
else else
...@@ -8879,27 +8889,27 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -8879,27 +8889,27 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
return target; return target;
case FIX_TRUNC_EXPR: case FIX_TRUNC_EXPR:
op0 = expand_normal (TREE_OPERAND (exp, 0)); op0 = expand_normal (treeop0);
if (target == 0 || modifier == EXPAND_STACK_PARM) if (target == 0 || modifier == EXPAND_STACK_PARM)
target = gen_reg_rtx (mode); target = gen_reg_rtx (mode);
expand_fix (target, op0, unsignedp); expand_fix (target, op0, unsignedp);
return target; return target;
case FLOAT_EXPR: case FLOAT_EXPR:
op0 = expand_normal (TREE_OPERAND (exp, 0)); op0 = expand_normal (treeop0);
if (target == 0 || modifier == EXPAND_STACK_PARM) if (target == 0 || modifier == EXPAND_STACK_PARM)
target = gen_reg_rtx (mode); target = gen_reg_rtx (mode);
/* expand_float can't figure out what to do if FROM has VOIDmode. /* expand_float can't figure out what to do if FROM has VOIDmode.
So give it the correct mode. With -O, cse will optimize this. */ So give it the correct mode. With -O, cse will optimize this. */
if (GET_MODE (op0) == VOIDmode) if (GET_MODE (op0) == VOIDmode)
op0 = copy_to_mode_reg (TYPE_MODE (TREE_TYPE (TREE_OPERAND (exp, 0))), op0 = copy_to_mode_reg (TYPE_MODE (TREE_TYPE (treeop0)),
op0); op0);
expand_float (target, op0, expand_float (target, op0,
TYPE_UNSIGNED (TREE_TYPE (TREE_OPERAND (exp, 0)))); TYPE_UNSIGNED (TREE_TYPE (treeop0)));
return target; return target;
case NEGATE_EXPR: case NEGATE_EXPR:
op0 = expand_expr (TREE_OPERAND (exp, 0), subtarget, op0 = expand_expr (treeop0, subtarget,
VOIDmode, EXPAND_NORMAL); VOIDmode, EXPAND_NORMAL);
if (modifier == EXPAND_STACK_PARM) if (modifier == EXPAND_STACK_PARM)
target = 0; target = 0;
...@@ -8911,7 +8921,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -8911,7 +8921,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
return REDUCE_BIT_FIELD (temp); return REDUCE_BIT_FIELD (temp);
case ABS_EXPR: case ABS_EXPR:
op0 = expand_expr (TREE_OPERAND (exp, 0), subtarget, op0 = expand_expr (treeop0, subtarget,
VOIDmode, EXPAND_NORMAL); VOIDmode, EXPAND_NORMAL);
if (modifier == EXPAND_STACK_PARM) if (modifier == EXPAND_STACK_PARM)
target = 0; target = 0;
...@@ -8926,7 +8936,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -8926,7 +8936,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
return op0; return op0;
return expand_abs (mode, op0, target, unsignedp, return expand_abs (mode, op0, target, unsignedp,
safe_from_p (target, TREE_OPERAND (exp, 0), 1)); safe_from_p (target, treeop0, 1));
case MAX_EXPR: case MAX_EXPR:
case MIN_EXPR: case MIN_EXPR:
...@@ -8938,7 +8948,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -8938,7 +8948,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
|| (REG_P (target) || (REG_P (target)
&& REGNO (target) < FIRST_PSEUDO_REGISTER)) && REGNO (target) < FIRST_PSEUDO_REGISTER))
target = gen_reg_rtx (mode); target = gen_reg_rtx (mode);
expand_operands (TREE_OPERAND (exp, 0), TREE_OPERAND (exp, 1), expand_operands (treeop0, treeop1,
target, &op0, &op1, EXPAND_NORMAL); target, &op0, &op1, EXPAND_NORMAL);
/* First try to do it with a special MIN or MAX instruction. /* First try to do it with a special MIN or MAX instruction.
...@@ -9044,7 +9054,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -9044,7 +9054,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
return target; return target;
case BIT_NOT_EXPR: case BIT_NOT_EXPR:
op0 = expand_expr (TREE_OPERAND (exp, 0), subtarget, op0 = expand_expr (treeop0, subtarget,
VOIDmode, EXPAND_NORMAL); VOIDmode, EXPAND_NORMAL);
if (modifier == EXPAND_STACK_PARM) if (modifier == EXPAND_STACK_PARM)
target = 0; target = 0;
...@@ -9095,13 +9105,13 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -9095,13 +9105,13 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
if (ALL_FIXED_POINT_MODE_P (mode)) if (ALL_FIXED_POINT_MODE_P (mode))
goto binop; goto binop;
if (! safe_from_p (subtarget, TREE_OPERAND (exp, 1), 1)) if (! safe_from_p (subtarget, treeop1, 1))
subtarget = 0; subtarget = 0;
if (modifier == EXPAND_STACK_PARM) if (modifier == EXPAND_STACK_PARM)
target = 0; target = 0;
op0 = expand_expr (TREE_OPERAND (exp, 0), subtarget, op0 = expand_expr (treeop0, subtarget,
VOIDmode, EXPAND_NORMAL); VOIDmode, EXPAND_NORMAL);
temp = expand_shift (code, mode, op0, TREE_OPERAND (exp, 1), target, temp = expand_shift (code, mode, op0, treeop1, target,
unsignedp); unsignedp);
if (code == LSHIFT_EXPR) if (code == LSHIFT_EXPR)
temp = REDUCE_BIT_FIELD (temp); temp = REDUCE_BIT_FIELD (temp);
...@@ -9139,7 +9149,8 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -9139,7 +9149,8 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
if (! ignore if (! ignore
&& (target == 0 && (target == 0
|| modifier == EXPAND_STACK_PARM || modifier == EXPAND_STACK_PARM
|| ! safe_from_p (target, exp, 1) || ! safe_from_p (target, treeop0, 1)
|| ! safe_from_p (target, treeop1, 1)
/* Make sure we don't have a hard reg (such as function's return /* Make sure we don't have a hard reg (such as function's return
value) live across basic blocks, if not optimizing. */ value) live across basic blocks, if not optimizing. */
|| (!optimize && REG_P (target) || (!optimize && REG_P (target)
...@@ -9161,7 +9172,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -9161,7 +9172,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
case TRUTH_NOT_EXPR: case TRUTH_NOT_EXPR:
if (modifier == EXPAND_STACK_PARM) if (modifier == EXPAND_STACK_PARM)
target = 0; target = 0;
op0 = expand_expr (TREE_OPERAND (exp, 0), target, op0 = expand_expr (treeop0, target,
VOIDmode, EXPAND_NORMAL); VOIDmode, EXPAND_NORMAL);
/* The parser is careful to generate TRUTH_NOT_EXPR /* The parser is careful to generate TRUTH_NOT_EXPR
only with operands that are always zero or one. */ only with operands that are always zero or one. */
...@@ -9185,7 +9196,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -9185,7 +9196,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
/* A COND_EXPR with its type being VOID_TYPE represents a /* A COND_EXPR with its type being VOID_TYPE represents a
conditional jump and is handled in conditional jump and is handled in
expand_gimple_cond_expr. */ expand_gimple_cond_expr. */
gcc_assert (!VOID_TYPE_P (TREE_TYPE (exp))); gcc_assert (!VOID_TYPE_P (type));
/* Note that COND_EXPRs whose type is a structure or union /* Note that COND_EXPRs whose type is a structure or union
are required to be constructed to contain assignments of are required to be constructed to contain assignments of
...@@ -9194,8 +9205,8 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -9194,8 +9205,8 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
gcc_assert (!TREE_ADDRESSABLE (type) gcc_assert (!TREE_ADDRESSABLE (type)
&& !ignore && !ignore
&& TREE_TYPE (TREE_OPERAND (exp, 1)) != void_type_node && TREE_TYPE (treeop1) != void_type_node
&& TREE_TYPE (TREE_OPERAND (exp, 2)) != void_type_node); && TREE_TYPE (treeop2) != void_type_node);
/* If we are not to produce a result, we have no target. Otherwise, /* If we are not to produce a result, we have no target. Otherwise,
if a target was specified use it; it will not be used as an if a target was specified use it; it will not be used as an
...@@ -9204,7 +9215,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -9204,7 +9215,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
if (modifier != EXPAND_STACK_PARM if (modifier != EXPAND_STACK_PARM
&& original_target && original_target
&& safe_from_p (original_target, TREE_OPERAND (exp, 0), 1) && safe_from_p (original_target, treeop0, 1)
&& GET_MODE (original_target) == mode && GET_MODE (original_target) == mode
#ifdef HAVE_conditional_move #ifdef HAVE_conditional_move
&& (! can_conditionally_move_p (mode) && (! can_conditionally_move_p (mode)
...@@ -9219,15 +9230,15 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -9219,15 +9230,15 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
NO_DEFER_POP; NO_DEFER_POP;
op0 = gen_label_rtx (); op0 = gen_label_rtx ();
op1 = gen_label_rtx (); op1 = gen_label_rtx ();
jumpifnot (TREE_OPERAND (exp, 0), op0); jumpifnot (treeop0, op0);
store_expr (TREE_OPERAND (exp, 1), temp, store_expr (treeop1, temp,
modifier == EXPAND_STACK_PARM, modifier == EXPAND_STACK_PARM,
false); false);
emit_jump_insn (gen_jump (op1)); emit_jump_insn (gen_jump (op1));
emit_barrier (); emit_barrier ();
emit_label (op0); emit_label (op0);
store_expr (TREE_OPERAND (exp, 2), temp, store_expr (treeop2, temp,
modifier == EXPAND_STACK_PARM, modifier == EXPAND_STACK_PARM,
false); false);
...@@ -9241,8 +9252,8 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -9241,8 +9252,8 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
case MODIFY_EXPR: case MODIFY_EXPR:
{ {
tree lhs = TREE_OPERAND (exp, 0); tree lhs = treeop0;
tree rhs = TREE_OPERAND (exp, 1); tree rhs = treeop1;
gcc_assert (ignore); gcc_assert (ignore);
/* Check for |= or &= of a bitfield of size one into another bitfield /* Check for |= or &= of a bitfield of size one into another bitfield
...@@ -9278,10 +9289,10 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -9278,10 +9289,10 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
} }
case RETURN_EXPR: case RETURN_EXPR:
if (!TREE_OPERAND (exp, 0)) if (!treeop0)
expand_null_return (); expand_null_return ();
else else
expand_return (TREE_OPERAND (exp, 0)); expand_return (treeop0);
return const0_rtx; return const0_rtx;
case ADDR_EXPR: case ADDR_EXPR:
...@@ -9289,11 +9300,11 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -9289,11 +9300,11 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
case COMPLEX_EXPR: case COMPLEX_EXPR:
/* Get the rtx code of the operands. */ /* Get the rtx code of the operands. */
op0 = expand_normal (TREE_OPERAND (exp, 0)); op0 = expand_normal (treeop0);
op1 = expand_normal (TREE_OPERAND (exp, 1)); op1 = expand_normal (treeop1);
if (!target) if (!target)
target = gen_reg_rtx (TYPE_MODE (TREE_TYPE (exp))); target = gen_reg_rtx (TYPE_MODE (type));
/* Move the real (op0) and imaginary (op1) parts to their location. */ /* Move the real (op0) and imaginary (op1) parts to their location. */
write_complex_part (target, op0, false); write_complex_part (target, op0, false);
...@@ -9302,11 +9313,11 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -9302,11 +9313,11 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
return target; return target;
case REALPART_EXPR: case REALPART_EXPR:
op0 = expand_normal (TREE_OPERAND (exp, 0)); op0 = expand_normal (treeop0);
return read_complex_part (op0, false); return read_complex_part (op0, false);
case IMAGPART_EXPR: case IMAGPART_EXPR:
op0 = expand_normal (TREE_OPERAND (exp, 0)); op0 = expand_normal (treeop0);
return read_complex_part (op0, true); return read_complex_part (op0, true);
case RESX_EXPR: case RESX_EXPR:
...@@ -9354,7 +9365,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -9354,7 +9365,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
return const0_rtx; return const0_rtx;
case LABEL_EXPR: case LABEL_EXPR:
expand_label (TREE_OPERAND (exp, 0)); expand_label (treeop0);
return const0_rtx; return const0_rtx;
case ASM_EXPR: case ASM_EXPR:
...@@ -9364,14 +9375,14 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -9364,14 +9375,14 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
case WITH_SIZE_EXPR: case WITH_SIZE_EXPR:
/* WITH_SIZE_EXPR expands to its first argument. The caller should /* WITH_SIZE_EXPR expands to its first argument. The caller should
have pulled out the size to use in whatever context it needed. */ have pulled out the size to use in whatever context it needed. */
return expand_expr_real (TREE_OPERAND (exp, 0), original_target, tmode, return expand_expr_real (treeop0, original_target, tmode,
modifier, alt_rtl); modifier, alt_rtl);
case REALIGN_LOAD_EXPR: case REALIGN_LOAD_EXPR:
{ {
tree oprnd0 = TREE_OPERAND (exp, 0); tree oprnd0 = treeop0;
tree oprnd1 = TREE_OPERAND (exp, 1); tree oprnd1 = treeop1;
tree oprnd2 = TREE_OPERAND (exp, 2); tree oprnd2 = treeop2;
rtx op2; rtx op2;
this_optab = optab_for_tree_code (code, type, optab_default); this_optab = optab_for_tree_code (code, type, optab_default);
...@@ -9385,9 +9396,9 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -9385,9 +9396,9 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
case DOT_PROD_EXPR: case DOT_PROD_EXPR:
{ {
tree oprnd0 = TREE_OPERAND (exp, 0); tree oprnd0 = treeop0;
tree oprnd1 = TREE_OPERAND (exp, 1); tree oprnd1 = treeop1;
tree oprnd2 = TREE_OPERAND (exp, 2); tree oprnd2 = treeop2;
rtx op2; rtx op2;
expand_operands (oprnd0, oprnd1, NULL_RTX, &op0, &op1, EXPAND_NORMAL); expand_operands (oprnd0, oprnd1, NULL_RTX, &op0, &op1, EXPAND_NORMAL);
...@@ -9399,8 +9410,8 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -9399,8 +9410,8 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
case WIDEN_SUM_EXPR: case WIDEN_SUM_EXPR:
{ {
tree oprnd0 = TREE_OPERAND (exp, 0); tree oprnd0 = treeop0;
tree oprnd1 = TREE_OPERAND (exp, 1); tree oprnd1 = treeop1;
expand_operands (oprnd0, oprnd1, NULL_RTX, &op0, &op1, EXPAND_NORMAL); expand_operands (oprnd0, oprnd1, NULL_RTX, &op0, &op1, EXPAND_NORMAL);
target = expand_widen_pattern_expr (exp, op0, NULL_RTX, op1, target = expand_widen_pattern_expr (exp, op0, NULL_RTX, op1,
...@@ -9412,7 +9423,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -9412,7 +9423,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
case REDUC_MIN_EXPR: case REDUC_MIN_EXPR:
case REDUC_PLUS_EXPR: case REDUC_PLUS_EXPR:
{ {
op0 = expand_normal (TREE_OPERAND (exp, 0)); op0 = expand_normal (treeop0);
this_optab = optab_for_tree_code (code, type, optab_default); this_optab = optab_for_tree_code (code, type, optab_default);
temp = expand_unop (mode, this_optab, op0, target, unsignedp); temp = expand_unop (mode, this_optab, op0, target, unsignedp);
gcc_assert (temp); gcc_assert (temp);
...@@ -9422,7 +9433,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -9422,7 +9433,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
case VEC_EXTRACT_EVEN_EXPR: case VEC_EXTRACT_EVEN_EXPR:
case VEC_EXTRACT_ODD_EXPR: case VEC_EXTRACT_ODD_EXPR:
{ {
expand_operands (TREE_OPERAND (exp, 0), TREE_OPERAND (exp, 1), expand_operands (treeop0, treeop1,
NULL_RTX, &op0, &op1, EXPAND_NORMAL); NULL_RTX, &op0, &op1, EXPAND_NORMAL);
this_optab = optab_for_tree_code (code, type, optab_default); this_optab = optab_for_tree_code (code, type, optab_default);
temp = expand_binop (mode, this_optab, op0, op1, target, unsignedp, temp = expand_binop (mode, this_optab, op0, op1, target, unsignedp,
...@@ -9434,7 +9445,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -9434,7 +9445,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
case VEC_INTERLEAVE_HIGH_EXPR: case VEC_INTERLEAVE_HIGH_EXPR:
case VEC_INTERLEAVE_LOW_EXPR: case VEC_INTERLEAVE_LOW_EXPR:
{ {
expand_operands (TREE_OPERAND (exp, 0), TREE_OPERAND (exp, 1), expand_operands (treeop0, treeop1,
NULL_RTX, &op0, &op1, EXPAND_NORMAL); NULL_RTX, &op0, &op1, EXPAND_NORMAL);
this_optab = optab_for_tree_code (code, type, optab_default); this_optab = optab_for_tree_code (code, type, optab_default);
temp = expand_binop (mode, this_optab, op0, op1, target, unsignedp, temp = expand_binop (mode, this_optab, op0, op1, target, unsignedp,
...@@ -9453,7 +9464,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -9453,7 +9464,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
case VEC_UNPACK_HI_EXPR: case VEC_UNPACK_HI_EXPR:
case VEC_UNPACK_LO_EXPR: case VEC_UNPACK_LO_EXPR:
{ {
op0 = expand_normal (TREE_OPERAND (exp, 0)); op0 = expand_normal (treeop0);
this_optab = optab_for_tree_code (code, type, optab_default); this_optab = optab_for_tree_code (code, type, optab_default);
temp = expand_widen_pattern_expr (exp, op0, NULL_RTX, NULL_RTX, temp = expand_widen_pattern_expr (exp, op0, NULL_RTX, NULL_RTX,
target, unsignedp); target, unsignedp);
...@@ -9464,14 +9475,14 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -9464,14 +9475,14 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
case VEC_UNPACK_FLOAT_HI_EXPR: case VEC_UNPACK_FLOAT_HI_EXPR:
case VEC_UNPACK_FLOAT_LO_EXPR: case VEC_UNPACK_FLOAT_LO_EXPR:
{ {
op0 = expand_normal (TREE_OPERAND (exp, 0)); op0 = expand_normal (treeop0);
/* The signedness is determined from input operand. */ /* The signedness is determined from input operand. */
this_optab = optab_for_tree_code (code, this_optab = optab_for_tree_code (code,
TREE_TYPE (TREE_OPERAND (exp, 0)), TREE_TYPE (treeop0),
optab_default); optab_default);
temp = expand_widen_pattern_expr temp = expand_widen_pattern_expr
(exp, op0, NULL_RTX, NULL_RTX, (exp, op0, NULL_RTX, NULL_RTX,
target, TYPE_UNSIGNED (TREE_TYPE (TREE_OPERAND (exp, 0)))); target, TYPE_UNSIGNED (TREE_TYPE (treeop0)));
gcc_assert (temp); gcc_assert (temp);
return temp; return temp;
...@@ -9480,8 +9491,8 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -9480,8 +9491,8 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
case VEC_WIDEN_MULT_HI_EXPR: case VEC_WIDEN_MULT_HI_EXPR:
case VEC_WIDEN_MULT_LO_EXPR: case VEC_WIDEN_MULT_LO_EXPR:
{ {
tree oprnd0 = TREE_OPERAND (exp, 0); tree oprnd0 = treeop0;
tree oprnd1 = TREE_OPERAND (exp, 1); tree oprnd1 = treeop1;
expand_operands (oprnd0, oprnd1, NULL_RTX, &op0, &op1, EXPAND_NORMAL); expand_operands (oprnd0, oprnd1, NULL_RTX, &op0, &op1, EXPAND_NORMAL);
target = expand_widen_pattern_expr (exp, op0, op1, NULL_RTX, target = expand_widen_pattern_expr (exp, op0, op1, NULL_RTX,
...@@ -9493,7 +9504,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -9493,7 +9504,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
case VEC_PACK_TRUNC_EXPR: case VEC_PACK_TRUNC_EXPR:
case VEC_PACK_SAT_EXPR: case VEC_PACK_SAT_EXPR:
case VEC_PACK_FIX_TRUNC_EXPR: case VEC_PACK_FIX_TRUNC_EXPR:
mode = TYPE_MODE (TREE_TYPE (TREE_OPERAND (exp, 0))); mode = TYPE_MODE (TREE_TYPE (treeop0));
goto binop; goto binop;
case COMPOUND_LITERAL_EXPR: case COMPOUND_LITERAL_EXPR:
...@@ -9523,7 +9534,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -9523,7 +9534,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
/* Here to do an ordinary binary operator. */ /* Here to do an ordinary binary operator. */
binop: binop:
expand_operands (TREE_OPERAND (exp, 0), TREE_OPERAND (exp, 1), expand_operands (treeop0, treeop1,
subtarget, &op0, &op1, EXPAND_NORMAL); subtarget, &op0, &op1, EXPAND_NORMAL);
binop2: binop2:
this_optab = optab_for_tree_code (code, type, optab_default); this_optab = optab_for_tree_code (code, type, optab_default);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment