temp = convert_to_mode (GET_MODE (target), temp, unsignedp);
emit_move_insn (target, temp);
}
- else if (GET_MODE (target) == BLKmode)
+ else if (GET_MODE (target) == BLKmode
+ || GET_MODE (temp) == BLKmode)
emit_block_move (target, temp, expr_size (exp),
(call_param_p
? BLOCK_OP_CALL_PARM
case UNION_TYPE:
case QUAL_UNION_TYPE:
- {
- /* Ho hum. How in the world do we guess here? Clearly it isn't
- right to count the fields. Guess based on the number of words. */
- HOST_WIDE_INT n = int_size_in_bytes (type);
- if (n < 0)
- return -1;
- return n / UNITS_PER_WORD;
- }
+ return -1;
case COMPLEX_TYPE:
return 2;
else if (TREE_CODE (exp) == BIT_FIELD_REF)
{
size_tree = TREE_OPERAND (exp, 1);
- *punsignedp = BIT_FIELD_REF_UNSIGNED (exp);
+ *punsignedp = (! INTEGRAL_TYPE_P (TREE_TYPE (exp))
+ || TYPE_UNSIGNED (TREE_TYPE (exp)));
/* For vector types, with the correct size of access, use the mode of
inner type. */
}
return expand_call (exp, target, ignore);
+ case PAREN_EXPR:
case NON_LVALUE_EXPR:
case NOP_EXPR:
case CONVERT_EXPR:
case BIT_XOR_EXPR:
goto binop;
- case LSHIFT_EXPR:
- case RSHIFT_EXPR:
case LROTATE_EXPR:
case RROTATE_EXPR:
+ /* The expansion code only handles expansion of mode precision
+ rotates. */
+ gcc_assert (GET_MODE_PRECISION (TYPE_MODE (type))
+ == TYPE_PRECISION (type));
+
+ /* Falltrough. */
+ case LSHIFT_EXPR:
+ case RSHIFT_EXPR:
/* If this is a fixed-point operation, then we cannot use the code
below because "expand_shift" doesn't support sat/no-sat fixed-point
shifts. */
target = 0;
op0 = expand_expr (TREE_OPERAND (exp, 0), subtarget,
VOIDmode, EXPAND_NORMAL);
- return expand_shift (code, mode, op0, TREE_OPERAND (exp, 1), target,
+ temp = expand_shift (code, mode, op0, TREE_OPERAND (exp, 1), target,
unsignedp);
+ if (code == LSHIFT_EXPR)
+ temp = REDUCE_BIT_FIELD (temp);
+ return temp;
/* Could determine the answer when only additive constants differ. Also,
the addition of one can be handled by changing the condition. */