aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Sandiford <richard@codesourcery.com>2006-01-27 16:17:39 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2006-01-27 16:17:39 +0000
commit929e5e5b5d1dcc5de28ab486605c889dc879ab20 (patch)
tree612feb4365b6606ca8a5b752114f712698b2215a /gcc
parentdccb60e93b6fe1b6acf55c4795815177981595e6 (diff)
downloadgcc-929e5e5b5d1dcc5de28ab486605c889dc879ab20.zip
gcc-929e5e5b5d1dcc5de28ab486605c889dc879ab20.tar.gz
gcc-929e5e5b5d1dcc5de28ab486605c889dc879ab20.tar.bz2
rtl.texi (SYMBOL_REF_DATA): Adjust documentation for new opaque type.
* doc/rtl.texi (SYMBOL_REF_DATA): Adjust documentation for new opaque type. * optabs.c (init_one_libfunc): Use SET_SYMBOL_REF_DECL. * varasm.c (make_decl_rtl, build_constant_desc): Likewise. (force_const_mem): Use SET_SYMBOL_REF_CONSTANT. * rtl.h (rtunion_def): Remove rt_ptr. (X0PTR): Delete. (SYMBOL_REF_DATA): Use X0ANY instead of X0PTR. (SET_SYMBOL_REF_DECL, SET_SYMBOL_REF_CONSTANT): New macros. * config/i386/winnt.c (i386_pe_mark_dllexport) (i386_pe_mark_dllimport): Use SET_SYMBOL_REF_DECL. From-SVN: r110300
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog14
-rw-r--r--gcc/config/i386/winnt.c4
-rw-r--r--gcc/doc/rtl.texi2
-rw-r--r--gcc/optabs.c2
-rw-r--r--gcc/rtl.h13
-rw-r--r--gcc/varasm.c6
6 files changed, 31 insertions, 10 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ccfff4b..589ef6f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,17 @@
+2006-01-27 Richard Sandiford <richard@codesourcery.com>
+
+ * doc/rtl.texi (SYMBOL_REF_DATA): Adjust documentation for new
+ opaque type.
+ * optabs.c (init_one_libfunc): Use SET_SYMBOL_REF_DECL.
+ * varasm.c (make_decl_rtl, build_constant_desc): Likewise.
+ (force_const_mem): Use SET_SYMBOL_REF_CONSTANT.
+ * rtl.h (rtunion_def): Remove rt_ptr.
+ (X0PTR): Delete.
+ (SYMBOL_REF_DATA): Use X0ANY instead of X0PTR.
+ (SET_SYMBOL_REF_DECL, SET_SYMBOL_REF_CONSTANT): New macros.
+ * config/i386/winnt.c (i386_pe_mark_dllexport)
+ (i386_pe_mark_dllimport): Use SET_SYMBOL_REF_DECL.
+
2006-01-27 Gabor Loki <loki@gcc.gnu.org>
* cfgcleanup.c (try_crossjump_to_edge): Fix comment typo.
diff --git a/gcc/config/i386/winnt.c b/gcc/config/i386/winnt.c
index 711766c..c7eae6c 100644
--- a/gcc/config/i386/winnt.c
+++ b/gcc/config/i386/winnt.c
@@ -229,7 +229,7 @@ i386_pe_mark_dllexport (tree decl)
idp = get_identifier (newname);
symref = gen_rtx_SYMBOL_REF (Pmode, IDENTIFIER_POINTER (idp));
- SYMBOL_REF_DATA (symref) = decl;
+ SET_SYMBOL_REF_DECL (symref, decl);
XEXP (DECL_RTL (decl), 0) = symref;
}
@@ -274,7 +274,7 @@ i386_pe_mark_dllimport (tree decl)
idp = get_identifier (newname);
symref = gen_rtx_SYMBOL_REF (Pmode, IDENTIFIER_POINTER (idp));
- SYMBOL_REF_DATA (symref) = decl;
+ SET_SYMBOL_REF_DECL (symref, decl);
newrtl = gen_rtx_MEM (Pmode,symref);
XEXP (DECL_RTL (decl), 0) = newrtl;
diff --git a/gcc/doc/rtl.texi b/gcc/doc/rtl.texi
index 6102616..c9f7c87 100644
--- a/gcc/doc/rtl.texi
+++ b/gcc/doc/rtl.texi
@@ -462,7 +462,7 @@ pool entry for @var{x}. It is null otherwise.
@findex SYMBOL_REF_DATA
@item SYMBOL_REF_DATA (@var{x})
-A @samp{void *} pointer used to store @code{SYMBOL_REF_DECL} or
+A field of opaque type used to store @code{SYMBOL_REF_DECL} or
@code{SYMBOL_REF_CONSTANT}.
@findex SYMBOL_REF_FLAGS
diff --git a/gcc/optabs.c b/gcc/optabs.c
index 972339c..48a3406 100644
--- a/gcc/optabs.c
+++ b/gcc/optabs.c
@@ -5133,7 +5133,7 @@ init_one_libfunc (const char *name)
/* Zap the nonsensical SYMBOL_REF_DECL for this. What we're left with
are the flags assigned by targetm.encode_section_info. */
- SYMBOL_REF_DATA (symbol) = 0;
+ SET_SYMBOL_REF_DECL (symbol, 0);
return symbol;
}
diff --git a/gcc/rtl.h b/gcc/rtl.h
index 8a959b8..250f383 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -172,7 +172,6 @@ union rtunion_def
mem_attrs *rt_mem;
reg_attrs *rt_reg;
struct constant_descriptor_rtx *rt_constant;
- void *rt_ptr;
};
typedef union rtunion_def rtunion;
@@ -633,7 +632,6 @@ extern void rtl_check_failed_flag (const char *, rtx, const char *,
#define X0MEMATTR(RTX, N) (RTL_CHECKC1 (RTX, N, MEM).rt_mem)
#define X0REGATTR(RTX, N) (RTL_CHECKC1 (RTX, N, REG).rt_reg)
#define X0CONSTANT(RTX, N) (RTL_CHECK1 (RTX, N, '0').rt_constant)
-#define X0PTR(RTX, N) (RTL_CHECK1 (RTX, N, '0').rt_ptr)
/* Access a '0' field with any type. */
#define X0ANY(RTX, N) RTL_CHECK1 (RTX, N, '0')
@@ -1199,12 +1197,21 @@ do { \
/* A pointer attached to the SYMBOL_REF; either SYMBOL_REF_DECL or
SYMBOL_REF_CONSTANT. */
-#define SYMBOL_REF_DATA(RTX) X0PTR ((RTX), 2)
+#define SYMBOL_REF_DATA(RTX) X0ANY ((RTX), 2)
+
+/* Set RTX's SYMBOL_REF_DECL to DECL. RTX must not be a constant
+ pool symbol. */
+#define SET_SYMBOL_REF_DECL(RTX, DECL) \
+ (gcc_assert (!CONSTANT_POOL_ADDRESS_P (RTX)), X0TREE ((RTX), 2) = (DECL))
/* The tree (decl or constant) associated with the symbol, or null. */
#define SYMBOL_REF_DECL(RTX) \
(CONSTANT_POOL_ADDRESS_P (RTX) ? NULL : X0TREE ((RTX), 2))
+/* Set RTX's SYMBOL_REF_CONSTANT to C. RTX must be a constant pool symbol. */
+#define SET_SYMBOL_REF_CONSTANT(RTX, C) \
+ (gcc_assert (CONSTANT_POOL_ADDRESS_P (RTX)), X0CONSTANT ((RTX), 2) = (C))
+
/* The rtx constant pool entry for a symbol, or null. */
#define SYMBOL_REF_CONSTANT(RTX) \
(CONSTANT_POOL_ADDRESS_P (RTX) ? X0CONSTANT ((RTX), 2) : NULL)
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 1a29d27..b398b59 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -845,7 +845,7 @@ make_decl_rtl (tree decl)
x = gen_rtx_SYMBOL_REF (Pmode, name);
SYMBOL_REF_WEAK (x) = DECL_WEAK (decl);
- SYMBOL_REF_DATA (x) = decl;
+ SET_SYMBOL_REF_DECL (x, decl);
x = gen_rtx_MEM (DECL_MODE (decl), x);
if (TREE_CODE (decl) != FUNCTION_DECL)
@@ -2573,7 +2573,7 @@ build_constant_desc (tree exp)
/* We have a symbol name; construct the SYMBOL_REF and the MEM. */
symbol = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (label));
SYMBOL_REF_FLAGS (symbol) = SYMBOL_FLAG_LOCAL;
- SYMBOL_REF_DATA (symbol) = desc->value;
+ SET_SYMBOL_REF_DECL (symbol, desc->value);
TREE_CONSTANT_POOL_ADDRESS_P (symbol) = 1;
rtl = gen_rtx_MEM (TYPE_MODE (TREE_TYPE (exp)), symbol);
@@ -2978,8 +2978,8 @@ force_const_mem (enum machine_mode mode, rtx x)
the constants pool. */
desc->sym = symbol = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (label));
SYMBOL_REF_FLAGS (symbol) = SYMBOL_FLAG_LOCAL;
- SYMBOL_REF_DATA (symbol) = desc;
CONSTANT_POOL_ADDRESS_P (symbol) = 1;
+ SET_SYMBOL_REF_CONSTANT (symbol, desc);
current_function_uses_const_pool = 1;
/* Construct the MEM. */