openwrt/toolchain/gcc/patches-14.x/110-Fix-MIPS-PR-84790.patch
Rui Salvaterra c758d6427c toolchain: gcc: add support for GCC 14
Deleted (upstreamed):
- 020-Include-safe-ctype.h-after-C-standard-headers-to-avo.patch [1]
- 021-libcc1-fix-vector-include.patch [2]

All other patches automatically rebased.

Note that selecting GCC 14, as of now, *will* result in build failures. The
packages that fail to build will be fixed as they're found. Thus, GCC 13.x is
the default, for the time being.

[1] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=9970b576b7e4ae337af1268395ff221348c4b34a
[2] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=5213047b1d50af63dfabb5e5649821a6cb157e33

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2024-05-12 12:47:12 +01:00

21 lines
686 B
Diff

Fix https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84790.
MIPS16 functions have a static assembler prologue which clobbers
registers v0 and v1. Add these register clobbers to function call
instructions.
--- a/gcc/config/mips/mips.cc
+++ b/gcc/config/mips/mips.cc
@@ -3227,6 +3227,12 @@ mips_emit_call_insn (rtx pattern, rtx or
emit_insn (gen_update_got_version ());
}
+ if (TARGET_MIPS16 && TARGET_USE_GOT)
+ {
+ clobber_reg (&CALL_INSN_FUNCTION_USAGE (insn), MIPS16_PIC_TEMP);
+ clobber_reg (&CALL_INSN_FUNCTION_USAGE (insn), MIPS_PROLOGUE_TEMP (word_mode));
+ }
+
if (TARGET_MIPS16
&& TARGET_EXPLICIT_RELOCS
&& TARGET_CALL_CLOBBERED_GP)