|| !multiple_p (bitpos, BITS_PER_UNIT)
|| !poly_int_tree_p (DECL_SIZE (TREE_OPERAND (exp, 1)),
&decl_bitsize)
- || maybe_ne (decl_bitsize, bitsize)))
+ || maybe_ne (decl_bitsize, bitsize))
+ /* A call with an addressable return type and return-slot
+ optimization must not need bitfield operations but we must
+ pass down the original target. */
+ && (TREE_CODE (exp) != CALL_EXPR
+ || !TREE_ADDRESSABLE (TREE_TYPE (exp))
+ || !CALL_EXPR_RETURN_SLOT_OPT (exp)))
/* If we are expanding a MEM_REF of a non-BLKmode non-addressable
decl we must use bitfield operations. */
|| (known_size_p (bitsize)