aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIain Sandoe <iain@sandoe.co.uk>2024-07-05 09:26:40 +0100
committerIain Sandoe <iains@gcc.gnu.org>2024-07-05 23:33:41 +0100
commit807e36d76e5105015afe0cf20e9a8837bb550f4b (patch)
tree18f193f9d3202308377fb56edd36f43584d3e9f1
parenteec30733bba305b02ba3c368289ef935f17c87e6 (diff)
downloadgcc-807e36d76e5105015afe0cf20e9a8837bb550f4b.zip
gcc-807e36d76e5105015afe0cf20e9a8837bb550f4b.tar.gz
gcc-807e36d76e5105015afe0cf20e9a8837bb550f4b.tar.bz2
x86, Darwin: Fix bootstrap for 32b multilibs/hosts.
r15-1735-ge62ea4fb8ffcab06ddd contained changes that altered the codegen for 32b Darwin (whether hosted on 64b or as 32b host) such that the per function picbase load is called multiple times in some cases. Darwin's back end is not expecting this (and indeed some of the handling depends on a single instance). The fixes the issue by marking those instructions as not copyable (as suggested by Andrew Pinski). The change is Darwin-specific. gcc/ChangeLog: * config/i386/i386.cc (ix86_cannot_copy_insn_p): New. (TARGET_CANNOT_COPY_INSN_P): New. Signed-off-by: Iain Sandoe <iains@gcc.gnu.org>
-rw-r--r--gcc/config/i386/i386.cc23
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/config/i386/i386.cc b/gcc/config/i386/i386.cc
index 99def8d..f75250f 100644
--- a/gcc/config/i386/i386.cc
+++ b/gcc/config/i386/i386.cc
@@ -27025,6 +27025,29 @@ ix86_libm_function_max_error (unsigned cfn, machine_mode mode,
#undef TARGET_LIBM_FUNCTION_MAX_ERROR
#define TARGET_LIBM_FUNCTION_MAX_ERROR ix86_libm_function_max_error
+#if TARGET_MACHO
+static bool
+ix86_cannot_copy_insn_p (rtx_insn *insn)
+{
+ if (TARGET_64BIT)
+ return false;
+
+ rtx set = single_set (insn);
+ if (set)
+ {
+ rtx src = SET_SRC (set);
+ if (GET_CODE (src) == UNSPEC
+ && XINT (src, 1) == UNSPEC_SET_GOT)
+ return true;
+ }
+ return false;
+}
+
+#undef TARGET_CANNOT_COPY_INSN_P
+#define TARGET_CANNOT_COPY_INSN_P ix86_cannot_copy_insn_p
+
+#endif
+
#if CHECKING_P
#undef TARGET_RUN_TARGET_SELFTESTS
#define TARGET_RUN_TARGET_SELFTESTS selftest::ix86_run_selftests