expr.c (expand_assignment): Add code to handle variable-sized BLKmode case.
* expr.c (expand_assignment): Add code to handle variable-sized BLKmode case. From-SVN: r32749
This commit is contained in:
parent
751312371e
commit
a69beca121
26
gcc/expr.c
26
gcc/expr.c
@ -3447,16 +3447,37 @@ expand_assignment (to, from, want_value, suggest_reg)
|
|||||||
TYPE_MODE (integer_type_node));
|
TYPE_MODE (integer_type_node));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* If this is a varying-length object, we must get the address of
|
||||||
|
the source and do an explicit block move. */
|
||||||
|
if (bitsize < 0)
|
||||||
|
{
|
||||||
|
unsigned int from_align;
|
||||||
|
rtx from_rtx = expand_expr_unaligned (from, &from_align);
|
||||||
|
rtx inner_to_rtx
|
||||||
|
= change_address (to_rtx, VOIDmode,
|
||||||
|
plus_constant (XEXP (to_rtx, 0),
|
||||||
|
bitpos / BITS_PER_UNIT));
|
||||||
|
|
||||||
|
emit_block_move (inner_to_rtx, from_rtx, expr_size (from),
|
||||||
|
MIN (alignment, from_align) / BITS_PER_UNIT);
|
||||||
|
free_temp_slots ();
|
||||||
|
pop_temp_slots ();
|
||||||
|
return to_rtx;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
result = store_field (to_rtx, bitsize, bitpos, mode1, from,
|
result = store_field (to_rtx, bitsize, bitpos, mode1, from,
|
||||||
(want_value
|
(want_value
|
||||||
/* Spurious cast makes HPUX compiler happy. */
|
/* Spurious cast for HPUX compiler. */
|
||||||
? (enum machine_mode) TYPE_MODE (TREE_TYPE (to))
|
? ((enum machine_mode)
|
||||||
|
TYPE_MODE (TREE_TYPE (to)))
|
||||||
: VOIDmode),
|
: VOIDmode),
|
||||||
unsignedp,
|
unsignedp,
|
||||||
/* Required alignment of containing datum. */
|
/* Required alignment of containing datum. */
|
||||||
alignment,
|
alignment,
|
||||||
int_size_in_bytes (TREE_TYPE (tem)),
|
int_size_in_bytes (TREE_TYPE (tem)),
|
||||||
get_alias_set (to));
|
get_alias_set (to));
|
||||||
|
|
||||||
preserve_temp_slots (result);
|
preserve_temp_slots (result);
|
||||||
free_temp_slots ();
|
free_temp_slots ();
|
||||||
pop_temp_slots ();
|
pop_temp_slots ();
|
||||||
@ -3469,6 +3490,7 @@ expand_assignment (to, from, want_value, suggest_reg)
|
|||||||
TREE_UNSIGNED (TREE_TYPE (to)))
|
TREE_UNSIGNED (TREE_TYPE (to)))
|
||||||
: NULL_RTX);
|
: NULL_RTX);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* If the rhs is a function call and its value is not an aggregate,
|
/* If the rhs is a function call and its value is not an aggregate,
|
||||||
call the function before we start to compute the lhs.
|
call the function before we start to compute the lhs.
|
||||||
|
Loading…
Reference in New Issue
Block a user