Commit a53f90ad by Eric Botcazou Committed by Eric Botcazou

expr.c (expand_expr_real_1): Use straight-line flow.

	* expr.c (expand_expr_real_1) <TARGET_MEM_REF>: Use straight-line flow.
	<MEM_REF>: Use 'type' instead of TREE_TYPE (exp) and tidy up the first
	part.  Use straight-line flow at the end.
	<COMPONENT_REF>: Remove superfluous else.
	<VIEW_CONVERT_EXPR>: Use 'type' instead of TREE_TYPE (exp).

From-SVN: r199986
parent 50d02961
2013-06-12 Eric Botcazou <ebotcazou@adacore.com>
* expr.c (expand_expr_real_1) <TARGET_MEM_REF>: Use straight-line flow.
<MEM_REF>: Use 'type' instead of TREE_TYPE (exp) and tidy up the first
part. Use straight-line flow at the end.
<COMPONENT_REF>: Remove superfluous else.
<VIEW_CONVERT_EXPR>: Use 'type' instead of TREE_TYPE (exp).
2013-06-12 Jakub Jelinek <jakub@redhat.com> 2013-06-12 Jakub Jelinek <jakub@redhat.com>
PR target/56564 PR target/56564
......
...@@ -9602,7 +9602,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -9602,7 +9602,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
create_output_operand (&ops[0], NULL_RTX, mode); create_output_operand (&ops[0], NULL_RTX, mode);
create_fixed_operand (&ops[1], temp); create_fixed_operand (&ops[1], temp);
expand_insn (icode, 2, ops); expand_insn (icode, 2, ops);
return ops[0].value; temp = ops[0].value;
} }
return temp; return temp;
} }
...@@ -9621,34 +9621,25 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -9621,34 +9621,25 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
if (mem_ref_refers_to_non_mem_p (exp)) if (mem_ref_refers_to_non_mem_p (exp))
{ {
HOST_WIDE_INT offset = mem_ref_offset (exp).low; HOST_WIDE_INT offset = mem_ref_offset (exp).low;
tree bit_offset;
tree bftype;
base = TREE_OPERAND (base, 0); base = TREE_OPERAND (base, 0);
if (offset == 0 if (offset == 0
&& host_integerp (TYPE_SIZE (TREE_TYPE (exp)), 1) && host_integerp (TYPE_SIZE (type), 1)
&& (GET_MODE_BITSIZE (DECL_MODE (base)) && (GET_MODE_BITSIZE (DECL_MODE (base))
== TREE_INT_CST_LOW (TYPE_SIZE (TREE_TYPE (exp))))) == TREE_INT_CST_LOW (TYPE_SIZE (type))))
return expand_expr (build1 (VIEW_CONVERT_EXPR, return expand_expr (build1 (VIEW_CONVERT_EXPR, type, base),
TREE_TYPE (exp), base),
target, tmode, modifier); target, tmode, modifier);
bit_offset = bitsize_int (offset * BITS_PER_UNIT); if (TYPE_MODE (type) == BLKmode)
bftype = TREE_TYPE (base);
if (TYPE_MODE (TREE_TYPE (exp)) != BLKmode)
bftype = TREE_TYPE (exp);
else
{ {
temp = assign_stack_temp (DECL_MODE (base), temp = assign_stack_temp (DECL_MODE (base),
GET_MODE_SIZE (DECL_MODE (base))); GET_MODE_SIZE (DECL_MODE (base)));
store_expr (base, temp, 0, false); store_expr (base, temp, 0, false);
temp = adjust_address (temp, BLKmode, offset); temp = adjust_address (temp, BLKmode, offset);
set_mem_size (temp, int_size_in_bytes (TREE_TYPE (exp))); set_mem_size (temp, int_size_in_bytes (type));
return temp; return temp;
} }
return expand_expr (build3 (BIT_FIELD_REF, bftype, exp = build3 (BIT_FIELD_REF, type, base, TYPE_SIZE (type),
base, bitsize_int (offset * BITS_PER_UNIT));
TYPE_SIZE (TREE_TYPE (exp)), return expand_expr (exp, target, tmode, modifier);
bit_offset),
target, tmode, modifier);
} }
address_mode = targetm.addr_space.address_mode (as); address_mode = targetm.addr_space.address_mode (as);
base = TREE_OPERAND (exp, 0); base = TREE_OPERAND (exp, 0);
...@@ -9690,7 +9681,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -9690,7 +9681,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
create_output_operand (&ops[0], NULL_RTX, mode); create_output_operand (&ops[0], NULL_RTX, mode);
create_fixed_operand (&ops[1], temp); create_fixed_operand (&ops[1], temp);
expand_insn (icode, 2, ops); expand_insn (icode, 2, ops);
return ops[0].value; temp = ops[0].value;
} }
else if (SLOW_UNALIGNED_ACCESS (mode, align)) else if (SLOW_UNALIGNED_ACCESS (mode, align))
temp = extract_bit_field (temp, GET_MODE_BITSIZE (mode), temp = extract_bit_field (temp, GET_MODE_BITSIZE (mode),
...@@ -10202,7 +10193,8 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -10202,7 +10193,8 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
|| modifier == EXPAND_CONST_ADDRESS || modifier == EXPAND_CONST_ADDRESS
|| modifier == EXPAND_INITIALIZER) || modifier == EXPAND_INITIALIZER)
return op0; return op0;
else if (target == 0)
if (target == 0)
target = gen_reg_rtx (tmode != VOIDmode ? tmode : mode); target = gen_reg_rtx (tmode != VOIDmode ? tmode : mode);
convert_move (target, op0, unsignedp); convert_move (target, op0, unsignedp);
...@@ -10249,7 +10241,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -10249,7 +10241,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
/* If we are converting to BLKmode, try to avoid an intermediate /* If we are converting to BLKmode, try to avoid an intermediate
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 (type)) == INTEGER_CST
&& TYPE_MODE (TREE_TYPE (treeop0)) != BLKmode && TYPE_MODE (TREE_TYPE (treeop0)) != BLKmode
&& handled_component_p (treeop0)) && handled_component_p (treeop0))
{ {
...@@ -10268,7 +10260,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -10268,7 +10260,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
if (!offset if (!offset
&& (bitpos % BITS_PER_UNIT) == 0 && (bitpos % BITS_PER_UNIT) == 0
&& bitsize >= 0 && bitsize >= 0
&& compare_tree_int (TYPE_SIZE (TREE_TYPE (exp)), bitsize) == 0) && compare_tree_int (TYPE_SIZE (type), bitsize) == 0)
{ {
/* See the normal_inner_ref case for the rationale. */ /* See the normal_inner_ref case for the rationale. */
orig_op0 orig_op0
...@@ -10309,8 +10301,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -10309,8 +10301,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
} }
if (!op0) if (!op0)
op0 = expand_expr (treeop0, 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. */
if (mode == GET_MODE (op0)) if (mode == GET_MODE (op0))
......
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