rtl.texi (SYMBOL_REF_DATA): Adjust documentation for new opaque type.
authorRichard Sandiford <richard@codesourcery.com>
Fri, 27 Jan 2006 16:17:39 +0000 (16:17 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Fri, 27 Jan 2006 16:17:39 +0000 (16:17 +0000)
* 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

gcc/ChangeLog
gcc/config/i386/winnt.c
gcc/doc/rtl.texi
gcc/optabs.c
gcc/rtl.h
gcc/varasm.c

index ccfff4b0c3a33d57c9550bd5734fa58eb17f5493..589ef6fedc3be3d887cf748458462a13b9be038f 100644 (file)
@@ -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.
index 711766c84f510077f1619a65312d9fe80954f512..c7eae6cb85d65a99735e09490e91921f62fb50cf 100644 (file)
@@ -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;
 
index 610261694b6d739285edfa8966200493fc04d6f9..c9f7c8750934ecca102445bf5c2667857fb9baa6 100644 (file)
@@ -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
index 972339c6605dc8e4f2f1a492ae3de91b13d2cd66..48a3406dc6bb0b4e15405eef2d052dfdb40cbb97 100644 (file)
@@ -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;
 }
index 8a959b89dbdcdf21fa70d476455d2bd37b8a2497..250f383307c4db602a08d7b1663080e946c84e97 100644 (file)
--- 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)
index 1a29d27804a873d5024bd1fc6353fcb9f7299a40..b398b59a6b6192d039fa85c7dc79e7162b8c6190 100644 (file)
@@ -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.  */