Module Name: src
Committed By: kalvisd
Date: Sun Sep 29 09:49:05 UTC 2024
Modified Files:
src/external/gpl3/gcc/dist/gcc: reload.cc
Log Message:
gcc: vax: additional constraints on address reloads
A reload for the address of an operand's address should not use the
same register as a reload of an operand's address if the two reloads
are for different operands
OK rin@
To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gcc/dist/gcc/reload.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/reload.cc
diff -u src/external/gpl3/gcc/dist/gcc/reload.cc:1.2 src/external/gpl3/gcc/dist/gcc/reload.cc:1.3
--- src/external/gpl3/gcc/dist/gcc/reload.cc:1.2 Sun Jul 30 06:15:16 2023
+++ src/external/gpl3/gcc/dist/gcc/reload.cc Sun Sep 29 09:49:05 2024
@@ -4554,6 +4554,53 @@ find_reloads (rtx_insn *insn, int replac
}
}
+#if 1
+ /*
+ * Scan the reloads again looking for a case where there is
+ * precisely one RELOAD_FOR_OPERAND_ADDRESS reload and one
+ * RELOAD_FOR_OPADDR_ADDR reload BUT they are for different
+ * operands. choose_reload_regs assumes that the
+ * RELOAD_FOR_OPADDR_ADDR and RELOAD_FOR_OPERAND_ADDRESS reloads are
+ * a pair operating on the same operand and will choose the same
+ * register for both, which is not what is wanted.
+ */
+ {
+ int need_change = 0;
+ int n_operand_address_reloads = 0,
+ n_opaddr_addr_reloads = 0;
+ int reloadnum_for_operand_address_reload = -1,
+ reloadnum_for_opaddr_addr_reload = -1;
+
+ for (i = 0; i < n_reloads; i++)
+ {
+ switch (rld[i].when_needed)
+ {
+ case RELOAD_FOR_OPADDR_ADDR:
+ n_opaddr_addr_reloads++;
+ reloadnum_for_opaddr_addr_reload = i;
+ break;
+ case RELOAD_FOR_OPERAND_ADDRESS:
+ n_operand_address_reloads++;
+ reloadnum_for_operand_address_reload = i;
+ break;
+ default:
+ break;
+ }
+ }
+ need_change =
+ (n_operand_address_reloads == 1
+ && n_opaddr_addr_reloads == 1
+ && rld[reloadnum_for_opaddr_addr_reload].opnum
+ != rld[reloadnum_for_operand_address_reload].opnum);
+
+ if (need_change)
+ {
+ rld[reloadnum_for_opaddr_addr_reload].when_needed
+ = RELOAD_FOR_OPERAND_ADDRESS;
+ }
+ }
+#endif
+
/* See if we have any reloads that are now allowed to be merged
because we've changed when the reload is needed to
RELOAD_FOR_OPERAND_ADDRESS or RELOAD_FOR_OTHER_ADDRESS. Only