switch (sty)
{
case SYMBOL_FORCE_TO_MEM:
+ if (int_mode != ptr_mode)
+ imm = convert_memory_address (ptr_mode, imm);
+
if (const_offset != 0
- && targetm.cannot_force_const_mem (int_mode, imm))
+ && targetm.cannot_force_const_mem (ptr_mode, imm))
{
gcc_assert (can_create_pseudo_p ());
base = aarch64_force_temporary (int_mode, dest, base);
}
break;
+ case UNSPEC:
+ /* Assume that all UNSPECs in a constant address can be converted
+ operand-by-operand. We could add a target hook if some targets
+ require different behavior. */
+ if (in_const && GET_MODE (x) == from_mode)
+ {
+ unsigned int n = XVECLEN (x, 0);
+ rtvec v = gen_rtvec (n);
+ for (unsigned int i = 0; i < n; ++i)
+ {
+ rtx op = XVECEXP (x, 0, i);
+ if (GET_MODE (op) == from_mode)
+ op = convert_memory_address_addr_space_1 (to_mode, op, as,
+ in_const, no_emit);
+ RTVEC_ELT (v, i) = op;
+ }
+ return gen_rtx_UNSPEC (to_mode, v, XINT (x, 1));
+ }
+ break;
+
default:
break;
}