Commit 05c0b405 by Per Bothner

expr.c (store_constructor): Fix flow control thinko (merge error).

* expr.c (store_constructor):  Fix flow control thinko (merge error).
* expr.c (store_constructor):  Pass correct value to recursive call.

From-SVN: r11272
parent 41531e5b
...@@ -3514,22 +3514,20 @@ store_constructor (exp, target, cleared) ...@@ -3514,22 +3514,20 @@ store_constructor (exp, target, cleared)
tree hi_index = TREE_OPERAND (index, 1); tree hi_index = TREE_OPERAND (index, 1);
rtx index_r, pos_rtx, addr, hi_r, loop_top, loop_end; rtx index_r, pos_rtx, addr, hi_r, loop_top, loop_end;
struct nesting *loop; struct nesting *loop;
HOST_WIDE_INT lo, hi, count;
tree position; tree position;
/* If the range is constant and "small", unroll the loop. */
if (TREE_CODE (lo_index) == INTEGER_CST if (TREE_CODE (lo_index) == INTEGER_CST
&& TREE_CODE (hi_index) == INTEGER_CST) && TREE_CODE (hi_index) == INTEGER_CST
{ && (lo = TREE_INT_CST_LOW (lo_index),
HOST_WIDE_INT lo = TREE_INT_CST_LOW (lo_index); hi = TREE_INT_CST_LOW (hi_index),
HOST_WIDE_INT hi = TREE_INT_CST_LOW (hi_index); count = hi - lo + 1,
HOST_WIDE_INT count = hi - lo + 1; (GET_CODE (target) != MEM
/* If the range is constant and "small", unroll the loop.
We must also use store_field if the target is not MEM. */
if (GET_CODE (target) != MEM
|| count <= 2 || count <= 2
|| (TREE_CODE (TYPE_SIZE (elttype)) == INTEGER_CST || (TREE_CODE (TYPE_SIZE (elttype)) == INTEGER_CST
&& TREE_INT_CST_LOW (TYPE_SIZE (elttype)) * count && TREE_INT_CST_LOW (TYPE_SIZE (elttype)) * count
<= 40 * 8)) <= 40 * 8))))
{ {
lo -= minelt; hi -= minelt; lo -= minelt; hi -= minelt;
for (; lo <= hi; lo++) for (; lo <= hi; lo++)
...@@ -3539,7 +3537,6 @@ store_constructor (exp, target, cleared) ...@@ -3539,7 +3537,6 @@ store_constructor (exp, target, cleared)
mode, value, type, cleared); mode, value, type, cleared);
} }
} }
}
else else
{ {
hi_r = expand_expr (hi_index, NULL_RTX, VOIDmode, 0); hi_r = expand_expr (hi_index, NULL_RTX, VOIDmode, 0);
...@@ -3575,7 +3572,7 @@ store_constructor (exp, target, cleared) ...@@ -3575,7 +3572,7 @@ store_constructor (exp, target, cleared)
addr = gen_rtx (PLUS, Pmode, XEXP (target, 0), pos_rtx); addr = gen_rtx (PLUS, Pmode, XEXP (target, 0), pos_rtx);
xtarget = change_address (target, mode, addr); xtarget = change_address (target, mode, addr);
if (TREE_CODE (value) == CONSTRUCTOR) if (TREE_CODE (value) == CONSTRUCTOR)
store_constructor (exp, xtarget, cleared); store_constructor (value, xtarget, cleared);
else else
store_expr (value, xtarget, 0); store_expr (value, xtarget, 0);
......
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