This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
fix alpha g++.dg/tls/diag-1.C
- From: Richard Henderson <rth at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sun, 25 Sep 2005 11:39:29 -0700
- Subject: fix alpha g++.dg/tls/diag-1.C
It appears that the symbol_ref bits aren't being set up quite
correctly, since poking the decl involved shows that it
satisfied binds_local_p, which implies that SYMBOL_REF_LOCAL_P
should have been set.
I couldn't quite figure out what went wrong with that.
But this change makes the rtl recognition routines match the rtl
expander routines, which has got to be a good thing for robustness.
r~
* config/alpha/alpha.c (tls_symbolic_operand_1): Trust
SYMBOL_REF_TLS_MODEL to be correct.
Index: config/alpha/alpha.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/alpha/alpha.c,v
retrieving revision 1.436
diff -u -p -d -r1.436 alpha.c
--- config/alpha/alpha.c 19 Sep 2005 17:05:44 -0000 1.436
+++ config/alpha/alpha.c 25 Sep 2005 18:33:11 -0000
@@ -533,25 +533,14 @@ tls_symbolic_operand_1 (rtx op, int size
if (GET_CODE (op) != SYMBOL_REF)
return 0;
- if (SYMBOL_REF_LOCAL_P (op))
- {
- if (alpha_tls_size > size)
- return 0;
- }
- else
- {
- if (size != 64)
- return 0;
- }
-
switch (SYMBOL_REF_TLS_MODEL (op))
{
case TLS_MODEL_LOCAL_DYNAMIC:
- return unspec == UNSPEC_DTPREL;
+ return unspec == UNSPEC_DTPREL && size == alpha_tls_size;
case TLS_MODEL_INITIAL_EXEC:
return unspec == UNSPEC_TPREL && size == 64;
case TLS_MODEL_LOCAL_EXEC:
- return unspec == UNSPEC_TPREL;
+ return unspec == UNSPEC_TPREL && size == alpha_tls_size;
default:
gcc_unreachable ();
}