Commit 2ae5ae57 by Richard Henderson Committed by Richard Henderson

i386.c (tls_model_chars): Remove.

        * config/i386/i386.c (tls_model_chars): Remove.
        (ix86_encode_section_info, ix86_strip_name_encoding): Remove.
        (local_symbolic_operand): Use SYMBOL_REF_LOCAL_P.
        (tls_symbolic_operand): Use SYMBOL_REF_TLS_MODEL.
        (tls_symbolic_operand_1): Likewise.
        (legitimate_pic_address_disp_p): Use SYMBOL_REF_LOCAL_P.
        * config/i386/i386.h (TARGET_ENCODE_SECTION_INFO): Remove.
        (TARGET_STRIP_NAME_ENCODING, ASM_OUTPUT_LABELREF): Remove.
        * config/i386/winnt.c (i386_pe_encode_section_info): Replace
        bits "copied from i386.h" with default_encode_section_info.

From-SVN: r65480
parent 52859c77
2003-04-11 Richard Henderson <rth@redhat.com> 2003-04-11 Richard Henderson <rth@redhat.com>
* config/i386/i386.c (tls_model_chars): Remove.
(ix86_encode_section_info, ix86_strip_name_encoding): Remove.
(local_symbolic_operand): Use SYMBOL_REF_LOCAL_P.
(tls_symbolic_operand): Use SYMBOL_REF_TLS_MODEL.
(tls_symbolic_operand_1): Likewise.
(legitimate_pic_address_disp_p): Use SYMBOL_REF_LOCAL_P.
* config/i386/i386.h (TARGET_ENCODE_SECTION_INFO): Remove.
(TARGET_STRIP_NAME_ENCODING, ASM_OUTPUT_LABELREF): Remove.
* config/i386/winnt.c (i386_pe_encode_section_info): Replace
bits "copied from i386.h" with default_encode_section_info.
2003-04-11 Richard Henderson <rth@redhat.com>
* rtl.def (SYMBOL_REF): Add two 0 fields. * rtl.def (SYMBOL_REF): Add two 0 fields.
* gengtype.c (adjust_field_rtx_def): Handle them. * gengtype.c (adjust_field_rtx_def): Handle them.
* print-rtl.c (print_rtx): Print them. * print-rtl.c (print_rtx): Print them.
......
...@@ -668,10 +668,6 @@ int const svr4_dbx_register_map[FIRST_PSEUDO_REGISTER] = ...@@ -668,10 +668,6 @@ int const svr4_dbx_register_map[FIRST_PSEUDO_REGISTER] =
rtx ix86_compare_op0 = NULL_RTX; rtx ix86_compare_op0 = NULL_RTX;
rtx ix86_compare_op1 = NULL_RTX; rtx ix86_compare_op1 = NULL_RTX;
/* The encoding characters for the four TLS models present in ELF. */
static char const tls_model_chars[] = " GLil";
#define MAX_386_STACK_LOCALS 3 #define MAX_386_STACK_LOCALS 3
/* Size of the register save area. */ /* Size of the register save area. */
#define X86_64_VARARGS_SIZE (REGPARM_MAX * UNITS_PER_WORD + SSE_REGPARM_MAX * 16) #define X86_64_VARARGS_SIZE (REGPARM_MAX * UNITS_PER_WORD + SSE_REGPARM_MAX * 16)
...@@ -845,10 +841,6 @@ static int ix86_address_cost PARAMS ((rtx)); ...@@ -845,10 +841,6 @@ static int ix86_address_cost PARAMS ((rtx));
static bool ix86_cannot_force_const_mem PARAMS ((rtx)); static bool ix86_cannot_force_const_mem PARAMS ((rtx));
static rtx ix86_delegitimize_address PARAMS ((rtx)); static rtx ix86_delegitimize_address PARAMS ((rtx));
static void ix86_encode_section_info PARAMS ((tree, int)) ATTRIBUTE_UNUSED;
static const char *ix86_strip_name_encoding PARAMS ((const char *))
ATTRIBUTE_UNUSED;
struct builtin_description; struct builtin_description;
static rtx ix86_expand_sse_comi PARAMS ((const struct builtin_description *, static rtx ix86_expand_sse_comi PARAMS ((const struct builtin_description *,
tree, rtx)); tree, rtx));
...@@ -3497,9 +3489,7 @@ local_symbolic_operand (op, mode) ...@@ -3497,9 +3489,7 @@ local_symbolic_operand (op, mode)
if (GET_CODE (op) != SYMBOL_REF) if (GET_CODE (op) != SYMBOL_REF)
return 0; return 0;
/* These we've been told are local by varasm and encode_section_info if (SYMBOL_REF_LOCAL_P (op))
respectively. */
if (CONSTANT_POOL_ADDRESS_P (op) || SYMBOL_REF_FLAG (op))
return 1; return 1;
/* There is, however, a not insubstantial body of code in the rest of /* There is, however, a not insubstantial body of code in the rest of
...@@ -3514,36 +3504,26 @@ local_symbolic_operand (op, mode) ...@@ -3514,36 +3504,26 @@ local_symbolic_operand (op, mode)
return 0; return 0;
} }
/* Test for various thread-local symbols. See ix86_encode_section_info. */ /* Test for various thread-local symbols. */
int int
tls_symbolic_operand (op, mode) tls_symbolic_operand (op, mode)
register rtx op; register rtx op;
enum machine_mode mode ATTRIBUTE_UNUSED; enum machine_mode mode ATTRIBUTE_UNUSED;
{ {
const char *symbol_str;
if (GET_CODE (op) != SYMBOL_REF) if (GET_CODE (op) != SYMBOL_REF)
return 0; return 0;
symbol_str = XSTR (op, 0); return SYMBOL_REF_TLS_MODEL (op);
if (symbol_str[0] != '%')
return 0;
return strchr (tls_model_chars, symbol_str[1]) - tls_model_chars;
} }
static int static inline int
tls_symbolic_operand_1 (op, kind) tls_symbolic_operand_1 (op, kind)
rtx op; rtx op;
enum tls_model kind; enum tls_model kind;
{ {
const char *symbol_str;
if (GET_CODE (op) != SYMBOL_REF) if (GET_CODE (op) != SYMBOL_REF)
return 0; return 0;
symbol_str = XSTR (op, 0); return SYMBOL_REF_TLS_MODEL (op) == kind;
return symbol_str[0] == '%' && symbol_str[1] == tls_model_chars[kind];
} }
int int
...@@ -5773,8 +5753,7 @@ legitimate_pic_address_disp_p (disp) ...@@ -5773,8 +5753,7 @@ legitimate_pic_address_disp_p (disp)
return 0; return 0;
if (GET_CODE (disp) == SYMBOL_REF if (GET_CODE (disp) == SYMBOL_REF
&& ix86_cmodel == CM_SMALL_PIC && ix86_cmodel == CM_SMALL_PIC
&& (CONSTANT_POOL_ADDRESS_P (disp) && SYMBOL_REF_LOCAL_P (disp))
|| SYMBOL_REF_FLAG (disp)))
return 1; return 1;
if (GET_CODE (disp) == LABEL_REF) if (GET_CODE (disp) == LABEL_REF)
return 1; return 1;
...@@ -5782,8 +5761,7 @@ legitimate_pic_address_disp_p (disp) ...@@ -5782,8 +5761,7 @@ legitimate_pic_address_disp_p (disp)
&& GET_CODE (XEXP (disp, 0)) == PLUS && GET_CODE (XEXP (disp, 0)) == PLUS
&& ((GET_CODE (XEXP (XEXP (disp, 0), 0)) == SYMBOL_REF && ((GET_CODE (XEXP (XEXP (disp, 0), 0)) == SYMBOL_REF
&& ix86_cmodel == CM_SMALL_PIC && ix86_cmodel == CM_SMALL_PIC
&& (CONSTANT_POOL_ADDRESS_P (XEXP (XEXP (disp, 0), 0)) && SYMBOL_REF_LOCAL_P (XEXP (XEXP (disp, 0), 0)))
|| SYMBOL_REF_FLAG (XEXP (XEXP (disp, 0), 0))))
|| GET_CODE (XEXP (XEXP (disp, 0), 0)) == LABEL_REF) || GET_CODE (XEXP (XEXP (disp, 0), 0)) == LABEL_REF)
&& GET_CODE (XEXP (XEXP (disp, 0), 1)) == CONST_INT && GET_CODE (XEXP (XEXP (disp, 0), 1)) == CONST_INT
&& INTVAL (XEXP (XEXP (disp, 0), 1)) < 16*1024*1024 && INTVAL (XEXP (XEXP (disp, 0), 1)) < 16*1024*1024
...@@ -6124,7 +6102,7 @@ ix86_GOT_alias_set () ...@@ -6124,7 +6102,7 @@ ix86_GOT_alias_set ()
2. Static data references, constant pool addresses, and code labels 2. Static data references, constant pool addresses, and code labels
compute the address as an offset from the GOT, whose base is in compute the address as an offset from the GOT, whose base is in
the PIC reg. Static data objects have SYMBOL_REF_FLAG set to the PIC reg. Static data objects have SYMBOL_FLAG_LOCAL set to
differentiate them from global data objects. The returned differentiate them from global data objects. The returned
address is the PIC reg + an unspec constant. address is the PIC reg + an unspec constant.
...@@ -6282,85 +6260,6 @@ legitimize_pic_address (orig, reg) ...@@ -6282,85 +6260,6 @@ legitimize_pic_address (orig, reg)
} }
return new; return new;
} }
static void
ix86_encode_section_info (decl, first)
tree decl;
int first ATTRIBUTE_UNUSED;
{
bool local_p = (*targetm.binds_local_p) (decl);
rtx rtl, symbol;
rtl = DECL_P (decl) ? DECL_RTL (decl) : TREE_CST_RTL (decl);
if (GET_CODE (rtl) != MEM)
return;
symbol = XEXP (rtl, 0);
if (GET_CODE (symbol) != SYMBOL_REF)
return;
/* For basic x86, if using PIC, mark a SYMBOL_REF for a non-global
symbol so that we may access it directly in the GOT. */
if (flag_pic)
SYMBOL_REF_FLAG (symbol) = local_p;
/* For ELF, encode thread-local data with %[GLil] for "global dynamic",
"local dynamic", "initial exec" or "local exec" TLS models
respectively. */
if (TREE_CODE (decl) == VAR_DECL && DECL_THREAD_LOCAL (decl))
{
const char *symbol_str;
char *newstr;
size_t len;
enum tls_model kind = decl_tls_model (decl);
if (TARGET_64BIT && ! flag_pic)
{
/* x86-64 doesn't allow non-pic code for shared libraries,
so don't generate GD/LD TLS models for non-pic code. */
switch (kind)
{
case TLS_MODEL_GLOBAL_DYNAMIC:
kind = TLS_MODEL_INITIAL_EXEC; break;
case TLS_MODEL_LOCAL_DYNAMIC:
kind = TLS_MODEL_LOCAL_EXEC; break;
default:
break;
}
}
symbol_str = XSTR (symbol, 0);
if (symbol_str[0] == '%')
{
if (symbol_str[1] == tls_model_chars[kind])
return;
symbol_str += 2;
}
len = strlen (symbol_str) + 1;
newstr = alloca (len + 2);
newstr[0] = '%';
newstr[1] = tls_model_chars[kind];
memcpy (newstr + 2, symbol_str, len);
XSTR (symbol, 0) = ggc_alloc_string (newstr, len + 2 - 1);
}
}
/* Undo the above when printing symbol names. */
static const char *
ix86_strip_name_encoding (str)
const char *str;
{
if (str[0] == '%')
str += 2;
if (str [0] == '*')
str += 1;
return str;
}
/* Load the thread pointer into a register. */ /* Load the thread pointer into a register. */
......
...@@ -2496,21 +2496,6 @@ enum ix86_builtins ...@@ -2496,21 +2496,6 @@ enum ix86_builtins
IX86_BUILTIN_MAX IX86_BUILTIN_MAX
}; };
#define TARGET_ENCODE_SECTION_INFO ix86_encode_section_info
#define TARGET_STRIP_NAME_ENCODING ix86_strip_name_encoding
#define ASM_OUTPUT_LABELREF(FILE,NAME) \
do { \
const char *xname = (NAME); \
if (xname[0] == '%') \
xname += 2; \
if (xname[0] == '*') \
xname += 1; \
else \
fputs (user_label_prefix, FILE); \
fputs (xname, FILE); \
} while (0)
/* Max number of args passed in registers. If this is more than 3, we will /* Max number of args passed in registers. If this is more than 3, we will
have problems with ebx (register #4), since it is a caller save register and have problems with ebx (register #4), since it is a caller save register and
is also used as the pic register in ELF. So for now, don't allow more than is also used as the pic register in ELF. So for now, don't allow more than
......
...@@ -429,14 +429,7 @@ i386_pe_encode_section_info (decl, first) ...@@ -429,14 +429,7 @@ i386_pe_encode_section_info (decl, first)
if (!first) if (!first)
return; return;
/* This bit is copied from i386.h. */ default_encode_section_info (decl, first);
if (optimize > 0 && TREE_CONSTANT (decl)
&& (!flag_writable_strings || TREE_CODE (decl) != STRING_CST))
{
rtx rtl = (TREE_CODE_CLASS (TREE_CODE (decl)) != 'd'
? TREE_CST_RTL (decl) : DECL_RTL (decl));
SYMBOL_REF_FLAG (XEXP (rtl, 0)) = 1;
}
if (TREE_CODE (decl) == FUNCTION_DECL) if (TREE_CODE (decl) == FUNCTION_DECL)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment