Module Name: src
Committed By: kalvisd
Date: Sun Sep 29 04:36:29 UTC 2024
Modified Files:
src/external/gpl3/gcc/dist/gcc/config/vax: vax.cc
Log Message:
gcc: vax:
Reduce expressions specifying an address of a 64 bit quantity to a
sequence of assignments to temporary variables; this allows virtual
registers to be instantiated properly.
OK rin@
To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/gcc/dist/gcc/config/vax/vax.cc
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/external/gpl3/gcc/dist/gcc/config/vax/vax.cc
diff -u src/external/gpl3/gcc/dist/gcc/config/vax/vax.cc:1.5 src/external/gpl3/gcc/dist/gcc/config/vax/vax.cc:1.6
--- src/external/gpl3/gcc/dist/gcc/config/vax/vax.cc:1.5 Sun Sep 29 04:33:07 2024
+++ src/external/gpl3/gcc/dist/gcc/config/vax/vax.cc Sun Sep 29 04:36:29 2024
@@ -1988,6 +1988,50 @@ vax_mode_dependent_address_p (const_rtx
}
static rtx
+decompose_address_operand(rtx addr)
+{
+ enum rtx_code code = GET_CODE (addr);
+
+ switch (code)
+ {
+ case CONST:
+ return decompose_address_operand (XEXP (addr, 0));
+ case PLUS:
+ case MULT:
+ {
+ rtx op0, op1;
+ rtx temp;
+ /*
+ * Generate a temporary register, assign the result of
+ * decomposing op0 to it, then generate an op code opping (PLUS
+ * or MULT) the result of decomposing op1 to it.
+ * Return the temporary register.
+ */
+ temp = gen_reg_rtx (Pmode);
+ op0 = decompose_address_operand (XEXP (addr, 0));
+ op1 = decompose_address_operand (XEXP (addr, 1));
+
+ emit_move_insn (temp, op0);
+
+ if (code == PLUS)
+ {
+ temp = gen_rtx_PLUS (Pmode, temp, op1);
+ }
+ else if (code == MULT)
+ {
+ temp = gen_rtx_MULT (Pmode, temp, op1);
+ }
+
+ return temp;
+ }
+ break;
+ default:
+ break;
+ }
+ return addr;
+}
+
+static rtx
fixup_mathdi_operand (rtx x, machine_mode mode)
{
if (illegal_addsub_di_memory_operand (x, mode))
@@ -2002,7 +2046,7 @@ fixup_mathdi_operand (rtx x, machine_mod
addr = XEXP (XEXP (addr, 0), 0);
}
#endif
- emit_move_insn (temp, addr);
+ emit_move_insn (temp, decompose_address_operand (addr));
if (offset)
temp = gen_rtx_PLUS (Pmode, temp, offset);
x = gen_rtx_MEM (DImode, temp);