This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
fix alpha tls spill bug
- From: Richard Henderson <rth at twiddle dot net>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 25 Aug 2004 19:34:57 -0700
- Subject: fix alpha tls spill bug
This shows up as failures in the glibc tls testsuite. Similar patches
have been applied for the other TLS targets; somehow alpha got missed.
Applied 3.4 and head.
r~
* config/alpha/alpha.c (alpha_cannot_force_const_mem): New.
(TARGET_CANNOT_FORCE_CONST_MEM): New.
Index: alpha.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/alpha/alpha.c,v
retrieving revision 1.342.4.9
diff -c -p -d -r1.342.4.9 alpha.c
*** alpha.c 17 Jul 2004 21:18:48 -0000 1.342.4.9
--- alpha.c 25 Aug 2004 21:07:55 -0000
*************** alpha_legitimize_address (rtx x, rtx scr
*** 1947,1952 ****
--- 1947,1963 ----
}
}
+ /* Primarily this is required for TLS symbols, but given that our move
+ patterns *ought* to be able to handle any symbol at any time, we
+ should never be spilling symbolic operands to the constant pool, ever. */
+
+ static bool
+ alpha_cannot_force_const_mem (rtx x)
+ {
+ enum rtx_code code = GET_CODE (x);
+ return code == SYMBOL_REF || code == LABEL_REF || code == CONST;
+ }
+
/* We do not allow indirect calls to be optimized into sibling calls, nor
can we allow a call to a function with a different GP to be optimized
into a sibcall. */
*************** alpha_init_libfuncs (void)
*** 10215,10220 ****
--- 10226,10233 ----
#define TARGET_FUNCTION_OK_FOR_SIBCALL alpha_function_ok_for_sibcall
#undef TARGET_CANNOT_COPY_INSN_P
#define TARGET_CANNOT_COPY_INSN_P alpha_cannot_copy_insn_p
+ #undef TARGET_CANNOT_FORCE_CONST_MEM
+ #define TARGET_CANNOT_FORCE_CONST_MEM alpha_cannot_force_const_mem
#if TARGET_ABI_OSF
#undef TARGET_ASM_OUTPUT_MI_THUNK
*************** struct gcc_target targetm = TARGET_INITI
*** 10257,10260 ****
#include "gt-alpha.h"
-
--- 10270,10272 ----