src = force_const_mem (mode, src);
/* When using explicit relocs, constant pool references are sometimes
- not legitimate addresses. */
- riscv_split_symbol (dest, XEXP (src, 0), mode, &XEXP (src, 0));
+ not legitimate addresses. If DEST is not a suitable register (ie,
+ not a Pmode pseudo), then let RISCV_SPLIT_SYMBOL generate a fresh
+ temporary. */
+ riscv_split_symbol (GET_MODE (dest) == Pmode ? dest : NULL_RTX,
+ XEXP (src, 0), mode, &XEXP (src, 0));
riscv_emit_move (dest, src);
}
--- /dev/null
+/* { dg-do compile { target rv64 } } */
+/* { dg-options "-Ofast -mcmodel=medany -mexplicit-relocs -march=rv64gv" } */
+typedef _Complex _Float16 CF;
+_Complex int ci;
+CF cf;
+
+void
+foo()
+{
+ ci += cf;
+ ci -= (CF)0;
+}