]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
varasm.c (make_decl_rtl): Remove call to REDO_SECTION_INFO_P; invoke ENCODE_SECTION_I...
authorRichard Henderson <rth@redhat.com>
Sun, 3 Mar 2002 04:23:21 +0000 (20:23 -0800)
committerRichard Henderson <rth@gcc.gnu.org>
Sun, 3 Mar 2002 04:23:21 +0000 (20:23 -0800)
* varasm.c (make_decl_rtl): Remove call to REDO_SECTION_INFO_P;
invoke ENCODE_SECTION_INFO with first call flag.

* config/darwin-protos.h, config/darwin.c, config/darwin.h,
config/a29k/a29k.h, config/alpha/alpha-protos.h, config/alpha/alpha.c,
config/alpha/alpha.h, config/arc/arc.h, config/arm/arm-protos.h,
config/arm/arm.h, config/arm/pe.c, config/arm/pe.h,
config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.h,
config/c4x/c4x-protos.h, config/c4x/c4x.c, config/c4x/c4x.h,
config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.h,
config/d30v/d30v.h, config/h8300/h8300.h, config/i370/i370.h,
config/i386/cygwin.h, config/i386/i386-interix.h, config/i386/i386.h,
config/i386/osfrose.h, config/i386/win32.h, config/i386/winnt.c,
config/ia64/ia64-protos.h, config/ia64/ia64.c, config/ia64/ia64.h,
config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m32r/m32r.h,
config/m68hc11/m68hc11-protos.h, config/m68hc11/m68hc11.c,
config/m68hc11/m68hc11.h, config/m88k/m88k.h,
config/mcore/mcore-protos.h, config/mcore/mcore.c,
config/mcore/mcore.h, config/mips/mips.h, config/ns32k/ns32k.h,
config/pa/pa.h, config/romp/romp.h, config/rs6000/linux64.h,
config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c,
config/rs6000/sysv4.h, config/rs6000/xcoff.h, config/s390/s390.h,
config/sh/sh.h, config/sparc/sparc.h,
config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c,
config/stormy16/stormy16.h, config/v850/v850.h, config/vax/vms.h,
config/xtensa/xtensa.h, doc/tm.texi: ENCODE_SECTION_INFO now takes
FIRST argument.  As needed, examine it and do nothing.

* config/darwin.h, config/alpha/alpha.h, config/arm/pe.h,
config/i386/cygwin.h, config/ia64/ia64.h, config/m68hc11/m68hc11.h,
config/mcore/mcore.h: Remove REDO_SECTION_INFO_P.

* config/arm/t-pe (pe.o): Add dependencies.

From-SVN: r50236

65 files changed:
gcc/ChangeLog
gcc/config/a29k/a29k.h
gcc/config/alpha/alpha-protos.h
gcc/config/alpha/alpha.c
gcc/config/alpha/alpha.h
gcc/config/arc/arc.h
gcc/config/arm/arm-protos.h
gcc/config/arm/arm.h
gcc/config/arm/pe.c
gcc/config/arm/pe.h
gcc/config/arm/t-pe
gcc/config/avr/avr-protos.h
gcc/config/avr/avr.c
gcc/config/avr/avr.h
gcc/config/c4x/c4x-protos.h
gcc/config/c4x/c4x.c
gcc/config/c4x/c4x.h
gcc/config/cris/cris-protos.h
gcc/config/cris/cris.c
gcc/config/cris/cris.h
gcc/config/d30v/d30v.h
gcc/config/darwin-protos.h
gcc/config/darwin.c
gcc/config/darwin.h
gcc/config/h8300/h8300.h
gcc/config/i370/i370.h
gcc/config/i386/cygwin.h
gcc/config/i386/i386-interix.h
gcc/config/i386/i386.h
gcc/config/i386/osfrose.h
gcc/config/i386/win32.h
gcc/config/i386/winnt.c
gcc/config/ia64/ia64-protos.h
gcc/config/ia64/ia64.c
gcc/config/ia64/ia64.h
gcc/config/m32r/m32r-protos.h
gcc/config/m32r/m32r.c
gcc/config/m32r/m32r.h
gcc/config/m68hc11/m68hc11-protos.h
gcc/config/m68hc11/m68hc11.c
gcc/config/m68hc11/m68hc11.h
gcc/config/m88k/m88k.h
gcc/config/mcore/mcore-protos.h
gcc/config/mcore/mcore.c
gcc/config/mcore/mcore.h
gcc/config/mips/mips.h
gcc/config/ns32k/ns32k.h
gcc/config/pa/pa.h
gcc/config/romp/romp.h
gcc/config/rs6000/linux64.h
gcc/config/rs6000/rs6000-protos.h
gcc/config/rs6000/rs6000.c
gcc/config/rs6000/sysv4.h
gcc/config/rs6000/xcoff.h
gcc/config/s390/s390.h
gcc/config/sh/sh.h
gcc/config/sparc/sparc.h
gcc/config/stormy16/stormy16-protos.h
gcc/config/stormy16/stormy16.c
gcc/config/stormy16/stormy16.h
gcc/config/v850/v850.h
gcc/config/vax/vms.h
gcc/config/xtensa/xtensa.h
gcc/doc/tm.texi
gcc/varasm.c

index eb73bd1a536f2fcd6c8a622a606ceaad803102a6..85872bbdc1af2e43a54708190a1a7a3c3103a3e1 100644 (file)
@@ -1,3 +1,39 @@
+2002-03-02  Richard Henderson  <rth@redhat.com>
+
+       * varasm.c (make_decl_rtl): Remove call to REDO_SECTION_INFO_P;
+       invoke ENCODE_SECTION_INFO with first call flag.
+
+       * config/darwin-protos.h, config/darwin.c, config/darwin.h,
+       config/a29k/a29k.h, config/alpha/alpha-protos.h, config/alpha/alpha.c,
+       config/alpha/alpha.h, config/arc/arc.h, config/arm/arm-protos.h, 
+       config/arm/arm.h, config/arm/pe.c, config/arm/pe.h,
+       config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.h,
+       config/c4x/c4x-protos.h, config/c4x/c4x.c, config/c4x/c4x.h,
+       config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.h,
+       config/d30v/d30v.h, config/h8300/h8300.h, config/i370/i370.h,
+       config/i386/cygwin.h, config/i386/i386-interix.h, config/i386/i386.h,
+       config/i386/osfrose.h, config/i386/win32.h, config/i386/winnt.c,
+       config/ia64/ia64-protos.h, config/ia64/ia64.c, config/ia64/ia64.h,
+       config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m32r/m32r.h,
+       config/m68hc11/m68hc11-protos.h, config/m68hc11/m68hc11.c, 
+       config/m68hc11/m68hc11.h, config/m88k/m88k.h, 
+       config/mcore/mcore-protos.h, config/mcore/mcore.c,
+       config/mcore/mcore.h, config/mips/mips.h, config/ns32k/ns32k.h,
+       config/pa/pa.h, config/romp/romp.h, config/rs6000/linux64.h,
+       config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, 
+       config/rs6000/sysv4.h, config/rs6000/xcoff.h, config/s390/s390.h,
+       config/sh/sh.h, config/sparc/sparc.h,
+       config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c,
+       config/stormy16/stormy16.h, config/v850/v850.h, config/vax/vms.h,
+       config/xtensa/xtensa.h, doc/tm.texi: ENCODE_SECTION_INFO now takes
+       FIRST argument.  As needed, examine it and do nothing.
+
+       * config/darwin.h, config/alpha/alpha.h, config/arm/pe.h, 
+       config/i386/cygwin.h, config/ia64/ia64.h, config/m68hc11/m68hc11.h,
+       config/mcore/mcore.h: Remove REDO_SECTION_INFO_P.
+
+       * config/arm/t-pe (pe.o): Add dependencies.
+
 2002-03-02  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
        * a29k.h, alpha.h, arc.h, arm.h, avr.h, clipper.h, convex.h,
index f499ea11b1595889f8d6b1b25af7e6b99b0fceb9..2c98d12a65065afbe54464249d87ed7f3807e9f3 100644 (file)
@@ -1366,7 +1366,7 @@ literal_section ()                                                \
    that we can branch to this function without emitting a no-op after the
    call.  */
 
-#define ENCODE_SECTION_INFO(DECL)  \
+#define ENCODE_SECTION_INFO(DECL, FIRST)  \
   if (TREE_CODE (DECL) == FUNCTION_DECL                        \
       && (TREE_ASM_WRITTEN (DECL) || ! TREE_PUBLIC (DECL))) \
     SYMBOL_REF_FLAG (XEXP (DECL_RTL (DECL), 0)) = 1;
index c6fdd042242e448a177d08239e9f5fb4a5d6975f..0ccdaaa0a1c929e68ab76aa78c12d399421c19d7 100644 (file)
@@ -165,7 +165,7 @@ extern void alpha_start_function PARAMS ((FILE *, const char *, tree));
 extern void alpha_end_function PARAMS ((FILE *, const char *, tree));
 extern void alpha_output_mi_thunk_osf PARAMS ((FILE *, tree,
                                               HOST_WIDE_INT, tree));
-extern void alpha_encode_section_info PARAMS ((tree));
+extern void alpha_encode_section_info PARAMS ((tree, int));
 #endif /* TREE CODE */
 
 #ifdef RTX_CODE
index aea7471f1ad2a646731790249abbc34c4d716555..58753467e4f66c1d5ad5165ada812789d3676aca 100644 (file)
@@ -1554,8 +1554,9 @@ decl_in_text_section (decl)
    then add "@s" instead.  */
 
 void
-alpha_encode_section_info (decl)
+alpha_encode_section_info (decl, first)
      tree decl;
+     int first ATTRIBUTE_UNUSED;
 {
   const char *symbol_str;
   bool is_local, is_small;
index 6d78d3ff82f31de7e7f7d0cc526cafca8852e5eb..3ea65568d469c60b4efc84c95f14a6bc9935f049 100644 (file)
@@ -1797,16 +1797,8 @@ literal_section ()                                               \
    depending on something about the variable or function named by the symbol
    (such as what section it is in).  */
 
-#define ENCODE_SECTION_INFO(DECL)  alpha_encode_section_info (DECL)
-
-/* If a variable is weakened, made one only or moved into a different
-   section, it may be necessary to redo the section info to move the
-   variable out of sdata.  */
-
-#define REDO_SECTION_INFO_P(DECL)                                       \
-   ((TREE_CODE (DECL) == VAR_DECL)                                      \
-    && (DECL_ONE_ONLY (DECL) || DECL_WEAK (DECL) || DECL_COMMON (DECL)  \
-        || DECL_SECTION_NAME (DECL) != 0))
+#define ENCODE_SECTION_INFO(DECL, FIRST)  \
+  alpha_encode_section_info (DECL, FIRST)
 
 #define STRIP_NAME_ENCODING(VAR,SYMBOL_NAME)   \
 do {                                           \
index 0a8385430d8fa52029145fea720aa88fd1bb3792..29edf4e95e1fd1a799dd83be0dc89bbeba0a539b 100644 (file)
@@ -1139,7 +1139,7 @@ extern const char *arc_text_section, *arc_data_section, *arc_rodata_section;
    Branch to absolute address insns take an address that is right-shifted
    by 2.  We encode the fact that we have a function here, and then emit a
    special assembler op when outputting the address.  */
-#define ENCODE_SECTION_INFO(DECL) \
+#define ENCODE_SECTION_INFO(DECL, FIRST)               \
 do {                                                   \
   if (TREE_CODE (DECL) == FUNCTION_DECL)               \
     SYMBOL_REF_FLAG (XEXP (DECL_RTL (DECL), 0)) = 1;   \
index b42da823869aa7eef5d4b2e26b634054c2799fb8..036ea44fed5db54340a997e62d4638f00c947dd2 100644 (file)
@@ -185,7 +185,7 @@ extern int  arm_dllimport_name_p    PARAMS ((const char *));
 
 #ifdef TREE_CODE
 extern void arm_pe_unique_section      PARAMS ((tree, int));
-extern void arm_pe_encode_section_info         PARAMS ((tree));
+extern void arm_pe_encode_section_info         PARAMS ((tree, int));
 extern int  arm_dllexport_p            PARAMS ((tree));
 extern int  arm_dllimport_p            PARAMS ((tree));
 extern void arm_mark_dllexport                 PARAMS ((tree));
index 8f4c4a1c8def4af75ae13eb3b10a47db845b8600..853db6da6d8c76e5c4d519a9ddc8f354fdc91330 100644 (file)
@@ -1912,7 +1912,7 @@ typedef struct
 /* This doesn't work with AOF syntax, since the string table may be in
    a different AREA.  */
 #ifndef AOF_ASSEMBLER
-#define ENCODE_SECTION_INFO(decl)                                      \
+#define ENCODE_SECTION_INFO(decl, first)                               \
 {                                                                      \
   if (optimize > 0 && TREE_CONSTANT (decl)                             \
       && (!flag_writable_strings || TREE_CODE (decl) != STRING_CST))   \
@@ -1921,12 +1921,14 @@ typedef struct
                  ? TREE_CST_RTL (decl) : DECL_RTL (decl));             \
       SYMBOL_REF_FLAG (XEXP (rtl, 0)) = 1;                             \
     }                                                                  \
-  ARM_ENCODE_CALL_TYPE (decl)                                          \
+  if (first)                                                           \
+    ARM_ENCODE_CALL_TYPE (decl)                                                \
 }
 #else
-#define ENCODE_SECTION_INFO(decl)                                      \
+#define ENCODE_SECTION_INFO(decl, first)                               \
 {                                                                      \
-  ARM_ENCODE_CALL_TYPE (decl)                                          \
+  if (first)                                                           \
+    ARM_ENCODE_CALL_TYPE (decl)                                                \
 }
 #endif
 
index 8360f85c44caa2da5d5789393e61cb150e9c4fb6..4069eac1ab2dfa4be930c5235db9016e93d6b15c 100644 (file)
@@ -207,8 +207,9 @@ arm_mark_dllimport (decl)
 /* Cover function to implement ENCODE_SECTION_INFO.  */
 
 void
-arm_pe_encode_section_info (decl)
+arm_pe_encode_section_info (decl, first)
      tree decl;
+     int first ATTRIBUTE_UNUSED;
 {
   /* This bit is copied from arm.h.  */
   if (optimize > 0 && TREE_CONSTANT (decl)
index 1182aac12c4d4cb1e67ad52bb1fa0ba26b9bf74d..6c4375de1224d26dba44951028c5604409abc252 100644 (file)
@@ -102,14 +102,8 @@ Boston, MA 02111-1307, USA.  */
    section and we need to set DECL_SECTION_NAME so we do that here.
    Note that we can be called twice on the same decl.  */
 #undef  ENCODE_SECTION_INFO
-#define ENCODE_SECTION_INFO(DECL) \
-  arm_pe_encode_section_info (DECL)
-
-/* Used to implement dllexport overriding dllimport semantics.  It's also used
-   to handle vtables - the first pass won't do anything because
-   DECL_CONTEXT (DECL) will be 0 so arm_dll{ex,im}port_p will return 0.
-   It's also used to handle dllimport override semantics.  */
-#define REDO_SECTION_INFO_P(DECL) 1
+#define ENCODE_SECTION_INFO(DECL, FIRST) \
+  arm_pe_encode_section_info (DECL, FIRST)
 
 /* Define this macro if in some cases global symbols from one translation
    unit may not be bound to undefined symbols in another translation unit
index 4de366521c068a5bf488f3f8dc60fed4c791b132..f559bd20cff9ea0c9b0619f36d5e4e745c88e242 100644 (file)
@@ -20,7 +20,8 @@ dp-bit.c: $(srcdir)/config/fp-bit.c
        echo '#endif' >> dp-bit.c
        cat $(srcdir)/config/fp-bit.c >> dp-bit.c
 
-pe.o: $(srcdir)/config/arm/pe.c
+pe.o: $(srcdir)/config/arm/pe.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) output.h \
+   flags.h $(TREE_H) $(EXPR_H) toplev.h $(TM_P_H)
        $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/arm/pe.c
 
 MULTILIB_OPTIONS = mhard-float mthumb
index e47b7e0ea6465eabed5fcdbbda08fe100d26e944..966a0cb28a4f1437beb6e9de268d5ef8e79a0490 100644 (file)
@@ -44,7 +44,7 @@ extern void   gas_output_ascii          PARAMS ((FILE *file, const char *str,
 extern void   asm_output_external          PARAMS ((FILE *file, tree decl,
                                                   char *name));
 extern void   unique_section               PARAMS ((tree decl, int reloc));
-extern void   encode_section_info          PARAMS ((tree decl));
+extern void   encode_section_info          PARAMS ((tree decl, int));
 extern int    avr_progmem_p                PARAMS ((tree decl));
 
 
index 8e64bcb74aaed250e14701aa02ac43bd63a10188..30ea833c751f11844402c4831012581f20069fa1 100644 (file)
@@ -4741,12 +4741,14 @@ avr_progmem_p (decl)
 /* Encode section information about tree DECL */
   
 void
-encode_section_info (decl)
+encode_section_info (decl, first)
      tree decl;
+     int first;
 {
   if (TREE_CODE (decl) == FUNCTION_DECL)
     SYMBOL_REF_FLAG (XEXP (DECL_RTL (decl), 0)) = 1;
-  else if ((TREE_STATIC (decl) || DECL_EXTERNAL (decl))
+  else if (first
+          && (TREE_STATIC (decl) || DECL_EXTERNAL (decl))
           && TREE_CODE (decl) == VAR_DECL
           && avr_progmem_p (decl))
     {
index ffcfa263095810ae91fe923331fc89a14ef2bc35..9b5b35f87405af7eeabf309c50b38ae60b3adf60 100644 (file)
@@ -1830,7 +1830,7 @@ progmem_section (void)                                                          \
    This macro is irrelevant if there is no separate readonly data
    section.  */
 
-#define ENCODE_SECTION_INFO(DECL)  encode_section_info(DECL)
+#define ENCODE_SECTION_INFO(DECL, FIRST)  encode_section_info(DECL, FIRST)
 /* Define this macro if references to a symbol must be treated
    differently depending on something about the variable or function
    named by the symbol (such as what section it is in).
index 1cd7fce9c50a46e9d2d9bbb9a147734717d9fdc1..d24a1f1bce4bc025e52058e48c153a7eb405b853 100644 (file)
@@ -53,7 +53,7 @@ extern struct rtx_def *c4x_function_arg PARAMS ((CUMULATIVE_ARGS *,
                                                 enum machine_mode, tree,
                                                 int));
 
-extern void c4x_encode_section_info PARAMS ((tree));
+extern void c4x_encode_section_info PARAMS ((tree, int));
 
 #endif /* TREE_CODE */
 
index ee878dd709886e66511486dbeb1b9803e365293f..6743990bede00225ff2cb593ce840ba32a6b581b 100644 (file)
@@ -1479,16 +1479,12 @@ c4x_emit_libcall_mulhi (libcall, code, mode, operands)
 /* Set the SYMBOL_REF_FLAG for a function decl.  However, wo do not
    yet use this info.  */
 void
-c4x_encode_section_info (decl)
-  tree decl;
+c4x_encode_section_info (decl, first)
+     tree decl;
+     int first ATTRIBUTE_UNUSED;
 {
-#if 0
-  if (TREE_CODE (TREE_TYPE (decl)) == FUNCTION_TYPE)   
-    SYMBOL_REF_FLAG (XEXP (DECL_RTL (decl), 0)) = 1;
-#else
   if (TREE_CODE (decl) == FUNCTION_DECL)   
     SYMBOL_REF_FLAG (XEXP (DECL_RTL (decl), 0)) = 1;
-#endif
 }
 
 
index 5ae16ab3306490d234ad22e236058373148670d0..ffa888e4e1a60315ec82748ded69bed35a776283 100644 (file)
@@ -1540,7 +1540,7 @@ CUMULATIVE_ARGS;
    On the C4x we use this to indicate if a symbol is in text or
    data space.  */
 
-#define ENCODE_SECTION_INFO(DECL) c4x_encode_section_info (DECL);
+#define ENCODE_SECTION_INFO(DECL, FIRST) c4x_encode_section_info (DECL, FIRST);
 
 /* Descripting Relative Cost of Operations.  */
 
index e13c94fb36db5418dc4bc68e0188e59b4c4fdd86..f5e9f76c7e219adeea0bb2c7153c2c32a040e7cd 100644 (file)
@@ -49,7 +49,7 @@ extern void cris_target_asm_named_section
 
 # ifdef TREE_CODE
 extern rtx cris_expand_builtin_va_arg PARAMS ((tree, tree));
-extern void cris_encode_section_info PARAMS ((tree));
+extern void cris_encode_section_info PARAMS ((tree, int));
 # endif
 #endif /* RTX_CODE */
 
index 063bad642ea4341e362b890468de853b85f49e83..72fc6b3acddf1cb8a0abeb21ec04498f09826903 100644 (file)
@@ -2999,8 +2999,9 @@ restart:
    functions.  */
 
 void
-cris_encode_section_info (exp)
+cris_encode_section_info (exp, first)
      tree exp;
+     int first ATTRIBUTE_UNUSED;
 {
   if (flag_pic)
     {
index 009b9aa33df3e992c6da96a0b7dcfd4608e91931..e1d7007ccd5cee354f9fabc270bf24051ed99952 100644 (file)
@@ -1446,7 +1446,7 @@ struct cum_args {int regs;};
 
 /* We need to code in PIC-specific flags into SYMBOL_REF_FLAG.  */
 
-#define ENCODE_SECTION_INFO(EXP) cris_encode_section_info (EXP)
+#define ENCODE_SECTION_INFO(EXP, FIRST) cris_encode_section_info (EXP, FIRST)
 
 /* We pull a little trick to register the _fini function with atexit,
    after (presumably) registering the eh frame info, since we don't handle
index 21745076b8189ed4cb4f6baafa030bec82bb07c1..aa4f7187d15523404ef0aa3ccffd3acd0b1c4b8c 100644 (file)
@@ -2794,19 +2794,6 @@ extern const char *d30v_branch_cost_string;
    This macro is irrelevant if there is no separate readonly data section.  */
 /* #define JUMP_TABLES_IN_TEXT_SECTION */
 
-/* Define this macro if references to a symbol must be treated differently
-   depending on something about the variable or function named by the symbol
-   (such as what section it is in).
-
-   The macro definition, if any, is executed immediately after the rtl for DECL
-   has been created and stored in `DECL_RTL (DECL)'.  The value of the rtl will
-   be a `mem' whose address is a `symbol_ref'.
-
-   The usual thing for this macro to do is to record a flag in the `symbol_ref'
-   (such as `SYMBOL_REF_FLAG') or to store a modified name string in the
-   `symbol_ref' (if one bit is not enough information).  */
-/* #define ENCODE_SECTION_INFO(DECL) */
-
 /* Decode SYM_NAME and store the real name part in VAR, sans the characters
    that encode section info.  Define this macro if `ENCODE_SECTION_INFO' alters
    the symbol's name string.  */
index 0bff1308d0130eae62756773f82a3225b8d4a695..5a93ca6515184f9dd1e7a317ba4a34e9dfdea089 100644 (file)
@@ -58,7 +58,7 @@ extern void machopic_define_ident PARAMS ((tree));
 extern void machopic_define_name PARAMS ((const char*));
 extern int machopic_name_defined_p PARAMS ((const char*));
 extern int machopic_ident_defined_p PARAMS ((tree));
-extern void darwin_encode_section_info PARAMS ((tree));
+extern void darwin_encode_section_info PARAMS ((tree, int));
 
 #endif /* TREE_CODE */
 
index 6864f0c8288355fbd5b60eb06f852e0589bb5bc3..f5e9db0e315462370c68bf6f92c1af9b61f09448 100644 (file)
@@ -952,8 +952,9 @@ machopic_operand_p (op)
    use later.  */
 
 void
-darwin_encode_section_info (decl)
+darwin_encode_section_info (decl, first)
      tree decl;
+     int first ATTRIBUTE_UNUSED;
 {
   char code = '\0';
   int defined = 0;
index 05ca85bdb8c96f77b0e4f5784e751fa0e7a14f2d..c5a078b025e50a655296a23f837d63f6da97a6c9 100644 (file)
@@ -208,7 +208,7 @@ do { text_section ();                                                       \
     if ((TREE_STATIC (DECL)                                             \
         && (!DECL_COMMON (DECL) || !TREE_PUBLIC (DECL)))               \
         || DECL_INITIAL (DECL))                                         \
-      ENCODE_SECTION_INFO (DECL);  \
+      ENCODE_SECTION_INFO (DECL, false);                               \
     ASM_OUTPUT_LABEL (FILE, xname);                                     \
   } while (0)
 
@@ -224,7 +224,7 @@ do { text_section ();                                                       \
     if ((TREE_STATIC (DECL)                                             \
         && (!DECL_COMMON (DECL) || !TREE_PUBLIC (DECL)))               \
         || DECL_INITIAL (DECL))                                         \
-      ENCODE_SECTION_INFO (DECL);                                      \
+      ENCODE_SECTION_INFO (DECL, false);                               \
     ASM_OUTPUT_LABEL (FILE, xname);                                     \
     /* Avoid generating stubs for functions we've just defined by      \
        outputting any required stub name label now.  */                        \
@@ -270,19 +270,20 @@ do { text_section ();                                                     \
 /* Ensure correct alignment of bss data.  */
 
 #undef ASM_OUTPUT_ALIGNED_DECL_LOCAL
-#define ASM_OUTPUT_ALIGNED_DECL_LOCAL(FILE, DECL, NAME, SIZE, ALIGN) \
-  do {  \
-    fputs (".lcomm ", (FILE));                         \
-    assemble_name ((FILE), (NAME));                    \
-    fprintf ((FILE), ",%u,%u\n", (SIZE), floor_log2 ((ALIGN) / BITS_PER_UNIT)); \
-    if ((DECL) && ((TREE_STATIC (DECL)                                             \
-        && (!DECL_COMMON (DECL) || !TREE_PUBLIC (DECL)))               \
-        || DECL_INITIAL (DECL)))                                         \
-      ENCODE_SECTION_INFO (DECL);  \
-    if ((DECL) && ((TREE_STATIC (DECL)                                             \
-        && (!DECL_COMMON (DECL) || !TREE_PUBLIC (DECL)))               \
-        || DECL_INITIAL (DECL)))                                         \
-      machopic_define_name (NAME);                                     \
+#define ASM_OUTPUT_ALIGNED_DECL_LOCAL(FILE, DECL, NAME, SIZE, ALIGN)   \
+  do {                                                                 \
+    fputs (".lcomm ", (FILE));                                         \
+    assemble_name ((FILE), (NAME));                                    \
+    fprintf ((FILE), ",%u,%u\n", (SIZE),                               \
+            floor_log2 ((ALIGN) / BITS_PER_UNIT));                     \
+    if ((DECL) && ((TREE_STATIC (DECL)                                 \
+        && (!DECL_COMMON (DECL) || !TREE_PUBLIC (DECL)))               \
+        || DECL_INITIAL (DECL)))                                       \
+      ENCODE_SECTION_INFO (DECL, false);                               \
+    if ((DECL) && ((TREE_STATIC (DECL)                                 \
+        && (!DECL_COMMON (DECL) || !TREE_PUBLIC (DECL)))               \
+        || DECL_INITIAL (DECL)))                                       \
+      machopic_define_name (NAME);                                     \
   } while (0)
 
 /* Output nothing for #ident.  */
@@ -716,12 +717,8 @@ enum machopic_addr_class {
 #define MACHOPIC_JUST_INDIRECT (flag_pic == 1)
 #define MACHOPIC_PURE          (flag_pic == 2)
 
-#define ENCODE_SECTION_INFO(DECL)  \
-  darwin_encode_section_info (DECL)
-
-/* Be conservative and always redo the encoding.  */
-
-#define REDO_SECTION_INFO_P(DECL) (1)
+#define ENCODE_SECTION_INFO(DECL, FIRST) \
+  darwin_encode_section_info (DECL, FIRST)
 
 #define STRIP_NAME_ENCODING(VAR,SYMBOL_NAME)  \
   ((VAR) = ((SYMBOL_NAME[0] == '!') ? (SYMBOL_NAME) + 4 : (SYMBOL_NAME)))
index b19c0b336fc3f04bf666e38799cdee1edcb4d138..3439453a1e58cb2c4f293803f4b9f220304349ac 100644 (file)
@@ -1140,7 +1140,7 @@ readonly_data ()                                                  \
 /* If we are referencing a function that is supposed to be called
    through the function vector, the SYMBOL_REF_FLAG in the rtl
    so the call patterns can generate the correct code.  */
-#define ENCODE_SECTION_INFO(DECL)                              \
+#define ENCODE_SECTION_INFO(DECL, FIRST)                       \
   if (TREE_CODE (DECL) == FUNCTION_DECL                                \
       && h8300_funcvec_function_p (DECL))                      \
     SYMBOL_REF_FLAG (XEXP (DECL_RTL (DECL), 0)) = 1;           \
@@ -1148,7 +1148,7 @@ readonly_data ()                                                  \
           && (TREE_STATIC (DECL) || DECL_EXTERNAL (DECL))      \
           && h8300_eightbit_data_p (DECL))                     \
     SYMBOL_REF_FLAG (XEXP (DECL_RTL (DECL), 0)) = 1;           \
-  else if (TREE_CODE (DECL) == VAR_DECL                                \
+  else if ((FIRST) && TREE_CODE (DECL) == VAR_DECL             \
           && (TREE_STATIC (DECL) || DECL_EXTERNAL (DECL))      \
           && h8300_tiny_data_p (DECL))                         \
     h8300_encode_label (DECL);
index d1f72bb8600245ce8315489c98c6eedeb1e230d1..206a94dc89d29a4792c613381f7dea19f5d4f7dd 100644 (file)
@@ -291,7 +291,7 @@ extern int mvs_function_name_length;
 
 /* Mark external references.  */
 
-#define ENCODE_SECTION_INFO(decl)                                      \
+#define ENCODE_SECTION_INFO(decl, first)                               \
   if (DECL_EXTERNAL (decl) && TREE_PUBLIC (decl))                      \
     SYMBOL_REF_FLAG (XEXP (DECL_RTL (decl), 0)) = 1;
 
index 2a812a5ff4dfce7943b69902fcc3eb7af6123f0b..aa05518ae46b9cdc5d5c01f676c1d1a72bb7acf3 100644 (file)
@@ -189,19 +189,6 @@ Boston, MA 02111-1307, USA.  */
 
 union tree_node;
 #define TREE union tree_node *
-
-/* Used to implement dllexport overriding dllimport semantics.  It's also used
-   to handle vtables - the first pass won't do anything because
-   DECL_CONTEXT (DECL) will be 0 so i386_pe_dll{ex,im}port_p will return 0.
-   It's also used to handle dllimport override semantics.  */
-#if 0
-#define REDO_SECTION_INFO_P(DECL) \
-  ((DECL_ATTRIBUTES (DECL) != NULL_TREE) \
-   || (TREE_CODE (DECL) == VAR_DECL && DECL_VIRTUAL_P (DECL)))
-#else
-#define REDO_SECTION_INFO_P(DECL) 1
-#endif
-
 \f
 #undef EXTRA_SECTIONS
 #define EXTRA_SECTIONS in_drectve
@@ -277,12 +264,11 @@ do {                                                                      \
    section and we need to set DECL_SECTION_NAME so we do that here.
    Note that we can be called twice on the same decl.  */
 
-extern void i386_pe_encode_section_info PARAMS ((TREE));
+extern void i386_pe_encode_section_info PARAMS ((TREE, int));
 
-#ifdef ENCODE_SECTION_INFO
 #undef ENCODE_SECTION_INFO
-#endif
-#define ENCODE_SECTION_INFO(DECL) i386_pe_encode_section_info (DECL)
+#define ENCODE_SECTION_INFO(DECL, FIRST) \
+  i386_pe_encode_section_info (DECL, FIRST)
 
 /* Utility used only in this file.  */
 #define I386_PE_STRIP_ENCODING(SYM_NAME) \
index 962862f0858b9a6487e4ddecf6cfb98403d91f43..495d9628351015231288edae4d6180e92aae78eb 100644 (file)
@@ -354,7 +354,7 @@ union tree_node;
 const char *gen_stdcall_suffix PARAMS ((union tree_node *));
 
 #undef ENCODE_SECTION_INFO
-#define ENCODE_SECTION_INFO(DECL)                                      \
+#define ENCODE_SECTION_INFO(DECL, FIRST)                               \
 do                                                                     \
   {                                                                    \
     if (flag_pic)                                                      \
@@ -365,7 +365,7 @@ do                                                                  \
          = (TREE_CODE_CLASS (TREE_CODE (DECL)) != 'd'                  \
             || ! TREE_PUBLIC (DECL));                                  \
       }                                                                        \
-    if (TREE_CODE (DECL) == FUNCTION_DECL)                             \
+    if ((FIRST) && TREE_CODE (DECL) == FUNCTION_DECL)                  \
       if (lookup_attribute ("stdcall",                                 \
                            TYPE_ATTRIBUTES (TREE_TYPE (DECL))))        \
         XEXP (DECL_RTL (DECL), 0) =                                    \
index a53a06f7148af46b53c516e83d71030f2e412fad..1a3d9abe58e03944fa97d639539e83c41986e731 100644 (file)
@@ -2244,7 +2244,7 @@ enum ix86_builtins
    On i386, if using PIC, mark a SYMBOL_REF for a non-global symbol
    so that we may access it directly in the GOT.  */
 
-#define ENCODE_SECTION_INFO(DECL)                              \
+#define ENCODE_SECTION_INFO(DECL, FIRST)                       \
 do {                                                           \
     if (flag_pic)                                              \
       {                                                                \
index 4580e0ef56d02fca8b68c010b882e059aba83a92..7338191293eba5ca57bd975dc1d79a3247938e19 100644 (file)
@@ -449,21 +449,23 @@ while (0)
    `PRINT_OPERAND_ADDRESS'.  */
 
 #undef ENCODE_SECTION_INFO
-#define ENCODE_SECTION_INFO(DECL)                                      \
-do                                                                     \
-  {                                                                    \
-   if (HALF_PIC_P ())                                                  \
-      HALF_PIC_ENCODE (DECL);                                          \
-                                                                       \
-   else if (flag_pic)                                                  \
-     {                                                                 \
-       rtx rtl = (TREE_CODE_CLASS (TREE_CODE (DECL)) != 'd'            \
-                 ? TREE_CST_RTL (DECL) : DECL_RTL (DECL));             \
-       SYMBOL_REF_FLAG (XEXP (rtl, 0))                                 \
-        = (TREE_CODE_CLASS (TREE_CODE (DECL)) != 'd'                   \
-           || ! TREE_PUBLIC (DECL));                                   \
-      }                                                                        \
-  }                                                                    \
+#define ENCODE_SECTION_INFO(DECL, FIRST)                       \
+do                                                             \
+  {                                                            \
+    if (HALF_PIC_P ())                                         \
+      {                                                                \
+       if (FIRST)                                              \
+         HALF_PIC_ENCODE (DECL);                               \
+      }                                                                \
+    else if (flag_pic)                                         \
+      {                                                                \
+       rtx rtl = (TREE_CODE_CLASS (TREE_CODE (DECL)) != 'd'    \
+                  ? TREE_CST_RTL (DECL) : DECL_RTL (DECL));    \
+       SYMBOL_REF_FLAG (XEXP (rtl, 0))                         \
+         = (TREE_CODE_CLASS (TREE_CODE (DECL)) != 'd'          \
+            || ! TREE_PUBLIC (DECL));                          \
+      }                                                                \
+  }                                                            \
 while (0)
 
 
index 0aa7a5794c4a8cd8dd720908b1116cbb504c3f1d..da1821d877c3d6499706ec0e420219a791274b68 100644 (file)
@@ -115,9 +115,8 @@ Boston, MA 02111-1307, USA.  */
    the number of bytes of arguments passed to the function, if it has the 
    attribute STDCALL.  */
 
-#ifdef ENCODE_SECTION_INFO
 #undef ENCODE_SECTION_INFO
-#define ENCODE_SECTION_INFO(DECL)                                      \
+#define ENCODE_SECTION_INFO(DECL, FIRST)                               \
 do                                                                     \
   {                                                                    \
     if (flag_pic)                                                      \
@@ -128,14 +127,13 @@ do                                                                        \
          = (TREE_CODE_CLASS (TREE_CODE (DECL)) != 'd'                  \
             || ! TREE_PUBLIC (DECL));                                  \
       }                                                                        \
-    if (TREE_CODE (DECL) == FUNCTION_DECL)                             \
+    if ((FIRST) && TREE_CODE (DECL) == FUNCTION_DECL)                  \
       if (lookup_attribute ("stdcall",                                 \
                            TYPE_ATTRIBUTES (TREE_TYPE (DECL))))        \
         XEXP (DECL_RTL (DECL), 0) =                                    \
           gen_rtx (SYMBOL_REF, Pmode, gen_stdcall_suffix (DECL));      \
   }                                                                    \
 while (0)
-#endif
 
 /* This macro gets just the user-specified name
    out of the string in a SYMBOL_REF.  Discard
index 9d955df2f48ea5c7f2c5d81e7596edb26a855d08..b8bb39e727b1e3c14a0e3488cecf5d58e2177add 100644 (file)
@@ -369,9 +369,13 @@ gen_stdcall_suffix (decl)
 /* Cover function to implement ENCODE_SECTION_INFO.  */
 
 void
-i386_pe_encode_section_info (decl)
+i386_pe_encode_section_info (decl, first)
      tree decl;
+     int first;
 {
+  if (!first)
+    return;
+
   /* This bit is copied from i386.h.  */
   if (optimize > 0 && TREE_CONSTANT (decl)
       && (!flag_writable_strings || TREE_CODE (decl) != STRING_CST))
index 43538cc749309d24eb7761a2577e23aece7a2e2d..332b07690b832faebeb9aa8d340d8e695bffe6cf 100644 (file)
@@ -116,7 +116,7 @@ extern void ia64_function_arg_advance PARAMS((CUMULATIVE_ARGS *,
 extern int ia64_return_in_memory PARAMS((tree));
 extern void ia64_asm_output_external PARAMS((FILE *, tree, const char *));
 
-extern void ia64_encode_section_info PARAMS((tree));
+extern void ia64_encode_section_info PARAMS((tree, int));
 #endif /* TREE_CODE */
 
 extern int ia64_register_move_cost PARAMS((enum machine_mode, enum reg_class,
index e4f6268b505e8a604d34e6117a7b67008161b94e..1c7c5a35876a0700404f7530715c1b19e1118b74 100644 (file)
@@ -6857,8 +6857,9 @@ const struct attribute_spec ia64_attribute_table[] =
 extern struct obstack * saveable_obstack;
 
 void
-ia64_encode_section_info (decl)
+ia64_encode_section_info (decl, first)
      tree decl;
+     int first ATTRIBUTE_UNUSED;
 {
   const char *symbol_str;
 
index 3c1d6b784435b49b628b822b48f8a079cf7652dc..50f7982ef32125f7487419023aa36411afef722e 100644 (file)
@@ -1764,16 +1764,7 @@ do {                                                                     \
    depending on something about the variable or function named by the symbol
    (such as what section it is in).  */
 
-#define ENCODE_SECTION_INFO(DECL) ia64_encode_section_info (DECL)
-
-/* If a variable is weakened, made one only or moved into a different
-   section, it may be necessary to redo the section info to move the
-   variable out of sdata.  */
-
-#define REDO_SECTION_INFO_P(DECL)                                      \
-   ((TREE_CODE (DECL) == VAR_DECL)                                     \
-    && (DECL_ONE_ONLY (DECL) || DECL_WEAK (DECL) || DECL_COMMON (DECL) \
-       || DECL_SECTION_NAME (DECL) != 0))
+#define ENCODE_SECTION_INFO(DECL, FIRST) ia64_encode_section_info (DECL, FIRST)
 
 #define SDATA_NAME_FLAG_CHAR '@'
 
index f76e6b918e249ca1fd0768a69b50926e67a97ed8..86adde0166d0e9825c906bbf1f49f19dcb68b84c 100644 (file)
@@ -34,7 +34,7 @@ extern void   m32r_asm_file_start             PARAMS ((FILE *));
 extern int    direct_return                    PARAMS ((void));
 #ifdef TREE_CODE
 extern void   m32r_select_section              PARAMS ((tree, int));
-extern void   m32r_encode_section_info         PARAMS ((tree));
+extern void   m32r_encode_section_info         PARAMS ((tree, int));
 extern enum m32r_function_type m32r_compute_function_type PARAMS ((tree));
 extern void   m32r_select_section              PARAMS ((tree, int));
 
index edf5fa4056e6fd354c2a025d05d2005545ed2cf9..0a985599a3e544c864b384af31361f482d1b8bd3 100644 (file)
@@ -366,12 +366,16 @@ m32r_select_section (decl, reloc)
 */
 
 void
-m32r_encode_section_info (decl)
+m32r_encode_section_info (decl, first)
      tree decl;
+     int first;
 {
   char prefix = 0;
   tree model = 0;
 
+  if (!first)
+    return;
+
   switch (TREE_CODE (decl))
     {
     case VAR_DECL :
index 44510a06bb7bafa1fea6cc5ed95fa7f1884f9566..dcbcfd5322b5426f9844291dcf4231ac17ebd636 100644 (file)
@@ -1644,7 +1644,7 @@ sbss_section ()                                                           \
  || MEDIUM_NAME_P (SYMBOL_NAME) \
  || LARGE_NAME_P (SYMBOL_NAME))
 
-#define ENCODE_SECTION_INFO(DECL) m32r_encode_section_info (DECL)
+#define ENCODE_SECTION_INFO(DECL, FIRST) m32r_encode_section_info (DECL, FIRST)
 
 /* Decode SYM_NAME and store the real name part in VAR, sans
    the characters that encode section info.  Define this macro if
index e775234eb54448d0233dc7ffffcb88a0e80d06a9..bbbb4525f4f36846c96b453ac2339d8fa820b19c 100644 (file)
@@ -41,7 +41,7 @@ extern void m68hc11_function_arg_advance PARAMS((CUMULATIVE_ARGS*,
                                                  enum machine_mode,
                                                  tree,
                                                  int));
-extern void m68hc11_encode_section_info PARAMS((tree));
+extern void m68hc11_encode_section_info PARAMS((tree, int));
 #endif
 
 #ifdef RTX_CODE
index f45d195e0203724ab187450035d3de4d5b3cdbaf..4946c3bb78cb1c19c4def39c852b4bf910917534 100644 (file)
@@ -1173,8 +1173,9 @@ m68hc11_handle_fntype_attribute (node, name, args, flags, no_add_attrs)
    handle calls to traps in a special manner (by issuing the trap).
    This information is stored in SYMBOL_REF_FLAG.  */
 void
-m68hc11_encode_section_info (decl)
+m68hc11_encode_section_info (decl, first)
      tree decl;
+     int first ATTRIBUTE_UNUSED;
 {
   tree func_attr;
   int trap_handler;
index 0e4b2022fd3d53843e477613f8b9e221ea97cd31..6afcf9a2173ac8e180eb9bc42d36c0efaf651f1c 100644 (file)
@@ -1146,11 +1146,8 @@ typedef struct m68hc11_args
    handle calls to traps in a special manner (by issuing the trap).
    This information is stored in SYMBOL_REF_FLAG.  */
 
-#define ENCODE_SECTION_INFO(DECL) m68hc11_encode_section_info (DECL)
-
-/* Override what GCC does for section info to let us recognize traps.  */
-
-#define REDO_SECTION_INFO_P(DECL) 1
+#define ENCODE_SECTION_INFO(DECL, FIRST) \
+  m68hc11_encode_section_info (DECL, FIRST)
 
 /* `INIT_TARGET_OPTABS'
      Define this macro as a C statement that declares additional library
index 11d8e544d068231d157ca7c50c03696606b0e746..a6da552387fd9c0bf15f212da185f3c36129fe1d 100644 (file)
@@ -2414,7 +2414,7 @@ sdata_section ()                                                  \
    rtl will be a `mem' whose address is a `symbol_ref'.
 
    For the m88k, determine if the item should go in the global pool.  */
-#define ENCODE_SECTION_INFO(DECL)                                      \
+#define ENCODE_SECTION_INFO(DECL, FIRST)                               \
   do {                                                                 \
     if (m88k_gp_threshold > 0)                                         \
     {                                                                  \
index d478f9003067592c9b47386115f358e00832273d..d6f6e2e8a46cf7d42647359cced0a9ccd7a524fd 100644 (file)
@@ -36,7 +36,7 @@ extern int          mcore_naked_function_p            PARAMS ((void));
 
 #ifdef TREE_CODE
 extern void         mcore_unique_section               PARAMS ((tree, int));
-extern void         mcore_encode_section_info          PARAMS ((tree));
+extern void         mcore_encode_section_info          PARAMS ((tree, int));
 
 #ifdef HAVE_MACHINE_MODES
 extern int          mcore_function_arg_partial_nregs   PARAMS ((CUMULATIVE_ARGS, enum machine_mode, tree, int));
index 2b6d1e8cedf2c0dfbe1dde5908cafd1d91c7e9a0..931cd06a99dbbb91b5468dd0af311e36bd987626 100644 (file)
@@ -3416,8 +3416,9 @@ mcore_dllimport_p (decl)
 
 /* Cover function to implement ENCODE_SECTION_INFO.  */
 void
-mcore_encode_section_info (decl)
+mcore_encode_section_info (decl, first)
      tree decl;
+     int first ATTRIBUTE_UNUSED;
 {
   /* This bit is copied from arm.h.  */
   if (optimize > 0
index ab02a2afb6b4afb02e9309d5dd68eeadcd722556..4899aa6cc1d91d61bff2fb36e0311bb876eef1a3 100644 (file)
@@ -1161,8 +1161,6 @@ switch_to_section (section, decl)                         \
 #undef  UNIQUE_SECTION
 #define UNIQUE_SECTION(DECL, RELOC) mcore_unique_section (DECL, RELOC)
 
-#define REDO_SECTION_INFO_P(DECL) 1
-
 #define MULTIPLE_SYMBOL_SPACES 1
 
 #define SUPPORTS_ONE_ONLY 1
@@ -1315,7 +1313,8 @@ extern long mcore_current_compilation_timestamp;
 /* We must mark dll symbols specially.  Definitions of dllexport'd objects
    install some info in the .drective (PE) or .exports (ELF) sections.   */
 #undef  ENCODE_SECTION_INFO
-#define ENCODE_SECTION_INFO(DECL) mcore_encode_section_info (DECL)
+#define ENCODE_SECTION_INFO(DECL, FIRST) \
+  mcore_encode_section_info (DECL, FIRST)
 
 /* Print operand X (an rtx) in assembler syntax to file FILE.
    CODE is a letter or dot (`z' in `%z0') or 0 if no letter was specified.
index 66c362124afac69e61e1b3e3403489ed0d6db6bd..39862a35e90f6084e4aff42e6f0235cd54a2df6e 100644 (file)
@@ -3343,12 +3343,12 @@ typedef struct mips_args {
    If you are changing this macro, you should look at
    mips_select_section and see if it needs a similar change.  */
 
-#define ENCODE_SECTION_INFO(DECL)                                      \
+#define ENCODE_SECTION_INFO(DECL, FIRST)                               \
 do                                                                     \
   {                                                                    \
     if (TARGET_MIPS16)                                                 \
       {                                                                        \
-       if (TREE_CODE (DECL) == STRING_CST                              \
+       if ((FIRST) && TREE_CODE (DECL) == STRING_CST                   \
            && ! flag_writable_strings                                  \
            /* If this string is from a function, and the function will \
               go in a gnu linkonce section, then we can't directly     \
@@ -3415,7 +3415,8 @@ do                                                                        \
                                                                        \
     else if (HALF_PIC_P ())                                            \
       {                                                                        \
-        HALF_PIC_ENCODE (DECL);                                                \
+       if (FIRST)                                                      \
+          HALF_PIC_ENCODE (DECL);                                      \
       }                                                                        \
   }                                                                    \
 while (0)
index 8ef5aeb9a8e480769614f62da78ba0de8f96c402..e0343a6985735cc7ce5d321cbe7060659fab26c8 100644 (file)
@@ -1064,7 +1064,7 @@ __transfer_from_trampoline ()             \
    symbol or a code symbol. These symbols are referenced via pc
    and not via sb. */
 
-#define ENCODE_SECTION_INFO(DECL) \
+#define ENCODE_SECTION_INFO(DECL, FIRST)                               \
 do                                                                     \
   {                                                                    \
     extern int flag_pic;                                               \
index 696068449d1da70bb5589d5c8e2c685d1d22ed0e..770f24363e84b8fc1490c1380cf435d617ba5d79 100644 (file)
@@ -1486,9 +1486,9 @@ do {                                                                      \
 
 #define FUNCTION_NAME_P(NAME)  (*(NAME) == '@')
 
-#define ENCODE_SECTION_INFO(DECL)\
+#define ENCODE_SECTION_INFO(DECL, FIRST)               \
 do                                                     \
-  { if (TEXT_SPACE_P (DECL))                           \
+  { if (FIRST && TEXT_SPACE_P (DECL))                  \
       {        rtx _rtl;                                       \
        if (TREE_CODE (DECL) == FUNCTION_DECL           \
            || TREE_CODE (DECL) == VAR_DECL)            \
index 5ce44f055e481070200cc52b5b518d0f3f1f73f9..a8e04dd8652002917d94f208531850a0c254ee67 100644 (file)
@@ -923,7 +923,7 @@ struct rt_cargs {int gregs, fregs; };
 /* For no good reason, we do the same as the other RT compilers and load
    the addresses of data areas for a function from our data area.  That means
    that we need to mark such SYMBOL_REFs.  We do so here.  */
-#define ENCODE_SECTION_INFO(DECL)                      \
+#define ENCODE_SECTION_INFO(DECL, FIRST)               \
   if (TREE_CODE (TREE_TYPE (DECL)) == FUNCTION_TYPE)   \
     SYMBOL_REF_FLAG (XEXP (DECL_RTL (DECL), 0)) = 1;
 
index 40b64dc3f9e7b801c2d90b46ad6312470ee86c86..109985998bc1d66a8ce8cf6fd90ec673799db1c1 100644 (file)
@@ -218,7 +218,7 @@ Boston, MA 02111-1307, USA.  */
    call.  Do not set this flag if the function is weakly defined.  */
 
 #undef  ENCODE_SECTION_INFO
-#define ENCODE_SECTION_INFO(DECL)                              \
+#define ENCODE_SECTION_INFO(DECL, FIRST)                       \
   if (TREE_CODE (DECL) == FUNCTION_DECL                                \
       && (TREE_ASM_WRITTEN (DECL) || ! TREE_PUBLIC (DECL))     \
       && ! DECL_WEAK (DECL))                                   \
index 19aeb07b9e0c26ca65f3142b7e20980857f6e35e..50367e35e25ca9c96c8ab585e6ecdd1e4bcf0f7a 100644 (file)
@@ -144,7 +144,7 @@ extern void setup_incoming_varargs PARAMS ((CUMULATIVE_ARGS *,
                                            int *, int));
 extern struct rtx_def *rs6000_va_arg PARAMS ((tree, tree));
 extern void output_mi_thunk PARAMS ((FILE *, tree, int, tree));
-extern void rs6000_encode_section_info PARAMS ((tree));
+extern void rs6000_encode_section_info PARAMS ((tree, int));
 extern void rs6000_select_section PARAMS ((tree, int));
 extern void rs6000_unique_section PARAMS ((tree, int));
 #ifdef ARGS_SIZE_RTX
index 887c3b4729ab28a3bb7d318e3f769d3e3a25d7e5..140593fe2334ca47de7f5c05f685b4e40eb91f6f 100644 (file)
@@ -10954,9 +10954,13 @@ rs6000_unique_section (decl, reloc)
    to read the prefixes.  */
 
 void
-rs6000_encode_section_info (decl)
+rs6000_encode_section_info (decl, first)
      tree decl;
+     int first;
 {
+  if (!first)
+    return;
+
   if (TREE_CODE (decl) == FUNCTION_DECL)
     {
       rtx sym_ref = XEXP (DECL_RTL (decl), 0);
index 8caa1cc21c9949f2c3abe69d13f76614293feac7..5373a6cd11a2f8b0430c3e922890798816df7263 100644 (file)
@@ -816,7 +816,8 @@ extern int fixuplabelno;
    to read the prefixes.  */
 
 #undef ENCODE_SECTION_INFO
-#define        ENCODE_SECTION_INFO(DECL) rs6000_encode_section_info (DECL)
+#define        ENCODE_SECTION_INFO(DECL, FIRST) \
+  rs6000_encode_section_info (DECL, FIRST)
 
 /* The ELF version doesn't encode [DS] or whatever at the end of symbols.  */
 
index 4a51b046ed1f05d9eec7b9463be57ca9d893d316..9fcedf8de5cda67690124d0d843668594cf11400 100644 (file)
@@ -207,7 +207,7 @@ toc_section ()                                              \
    that we can branch to this function without emitting a no-op after the
    call.  Do not set this flag if the function is weakly defined.  */
 
-#define ENCODE_SECTION_INFO(DECL)                      \
+#define ENCODE_SECTION_INFO(DECL, FIRST)               \
   if (TREE_CODE (DECL) == FUNCTION_DECL                        \
       && !TREE_PUBLIC (DECL)                           \
       && !DECL_WEAK (DECL))                            \
index e395f852de4df4d1fe8f1d8a930c48158053e656..b8e86bb8c873ba720963575154d443479450ab6f 100644 (file)
@@ -409,7 +409,7 @@ do                                                          \
    On s390, if using PIC, mark a SYMBOL_REF for a non-global symbol
    so that we may access it directly in the GOT.  */
 
-#define ENCODE_SECTION_INFO(DECL)                               \
+#define ENCODE_SECTION_INFO(DECL, FIRST)                        \
 do                                                              \
   {                                                             \
     if (flag_pic)                                               \
index e9195970c796df17df89dbea407547fe176c8001..28cf110c0ec39d197b601c7bd14d5bf673e16420 100644 (file)
@@ -2688,31 +2688,33 @@ while (0)
    On SH, if using PIC, mark a SYMBOL_REF for a non-global symbol
    so that we may access it using GOTOFF instead of GOT.  */
 
-#define ENCODE_SECTION_INFO(DECL) \
-do                                                                     \
-  {                                                                    \
-    if (flag_pic)                                                      \
-      {                                                                        \
-       rtx rtl = (TREE_CODE_CLASS (TREE_CODE (DECL)) != 'd'            \
-                  ? TREE_CST_RTL (DECL) : DECL_RTL (DECL));            \
-                                                                       \
-       SYMBOL_REF_FLAG (XEXP (rtl, 0)) =                               \
-         (TREE_CODE_CLASS (TREE_CODE (DECL)) != 'd'                    \
-          || ! TREE_PUBLIC (DECL));                                    \
-      }                                                                        \
-    if (TARGET_SH5)                                                    \
-      {                                                                        \
-       rtx rtl = (TREE_CODE_CLASS (TREE_CODE (DECL)) != 'd'            \
-                  ? TREE_CST_RTL (DECL)                                \
-                  : TREE_CODE (DECL) != VAR_DECL                       \
-                  ? NULL_RTX                                           \
-                  : DECL_RTL (DECL));                                  \
-                                                                       \
-        if (rtl && GET_CODE (rtl) == MEM                               \
-           && GET_CODE (XEXP (rtl, 0)) == SYMBOL_REF)                  \
-         XEXP (rtl, 0) = gen_datalabel_ref (XEXP (rtl, 0));            \
-      }                                                                        \
-  }                                                                    \
+#define ENCODE_SECTION_INFO(DECL, FIRST)                       \
+do                                                             \
+  {                                                            \
+    if (!(FIRST))                                              \
+      break;                                                   \
+    if (flag_pic)                                              \
+      {                                                                \
+       rtx rtl = (TREE_CODE_CLASS (TREE_CODE (DECL)) != 'd'    \
+                  ? TREE_CST_RTL (DECL) : DECL_RTL (DECL));    \
+                                                               \
+       SYMBOL_REF_FLAG (XEXP (rtl, 0)) =                       \
+         (TREE_CODE_CLASS (TREE_CODE (DECL)) != 'd'            \
+          || ! TREE_PUBLIC (DECL));                            \
+      }                                                                \
+    if (TARGET_SH5)                                            \
+      {                                                                \
+       rtx rtl = (TREE_CODE_CLASS (TREE_CODE (DECL)) != 'd'    \
+                  ? TREE_CST_RTL (DECL)                        \
+                  : TREE_CODE (DECL) != VAR_DECL               \
+                  ? NULL_RTX                                   \
+                  : DECL_RTL (DECL));                          \
+                                                               \
+        if (rtl && GET_CODE (rtl) == MEM                       \
+           && GET_CODE (XEXP (rtl, 0)) == SYMBOL_REF)          \
+         XEXP (rtl, 0) = gen_datalabel_ref (XEXP (rtl, 0));    \
+      }                                                                \
+  }                                                            \
 while (0)
 
 /* The prefix used to mark SYMBOL_REFs that refer to data symbols.  */
index 3faf25b8673bb3312f46887ff45fb84c263f3c5b..22645c3b530772dc84a70966c6fd6bfefe89e408 100644 (file)
@@ -2383,10 +2383,10 @@ do {                                                                    \
    In the Embedded Medium/Anywhere code model, %g4 points to the data segment
    so we must not add it to function addresses.  */
 
-#define ENCODE_SECTION_INFO(DECL) \
-  do {                                                 \
-    if (TARGET_CM_EMBMEDANY && TREE_CODE (DECL) == FUNCTION_DECL) \
-      SYMBOL_REF_FLAG (XEXP (DECL_RTL (DECL), 0)) = 1; \
+#define ENCODE_SECTION_INFO(DECL, FIRST)                               \
+  do {                                                                 \
+    if (TARGET_CM_EMBMEDANY && TREE_CODE (DECL) == FUNCTION_DECL)      \
+      SYMBOL_REF_FLAG (XEXP (DECL_RTL (DECL), 0)) = 1;                 \
   } while (0)
 \f
 /* Specify the machine mode that this machine uses
index 76d0bc0dcfedf298c9b57ade53fa2112d0bbfb88..fdae8a466a9118a8556a21e618e6297a96e8a19e 100644 (file)
@@ -38,7 +38,7 @@ extern CUMULATIVE_ARGS xstormy16_function_arg_advance
 extern void    xstormy16_setup_incoming_varargs 
   PARAMS ((CUMULATIVE_ARGS, int, tree, int *));
 extern tree    xstormy16_build_va_list PARAMS ((void));
-extern void    xstormy16_encode_section_info PARAMS ((tree));
+extern void    xstormy16_encode_section_info PARAMS ((tree, int));
 #endif
 
 #if defined (TREE_CODE) && defined (RTX_CODE)
index 0a886aceea4b6224d0ca66148a2b89e8820b8c77..dedc9be5ffe52baf754e4ce7295b1eab8fa903be 100644 (file)
@@ -1394,8 +1394,9 @@ xstormy16_asm_output_mi_thunk (file, thunk_fndecl, delta, function)
 /* Mark functions with SYMBOL_REF_FLAG.  */
 
 void
-xstormy16_encode_section_info (decl)
+xstormy16_encode_section_info (decl, first)
      tree decl;
+     int first ATTRIBUTE_UNUSED;
 {
   if (TREE_CODE (decl) == FUNCTION_DECL)
     SYMBOL_REF_FLAG (XEXP (DECL_RTL (decl), 0)) = 1;
index c2fd617d63807d886f84d8c1a33e51083ab80ebf..6ebb43f1bb3098c8bf7eb90a84e4d169d0c73775 100644 (file)
@@ -2593,7 +2593,8 @@ do {                                                      \
    The usual thing for this macro to do is to record a flag in the `symbol_ref'
    (such as `SYMBOL_REF_FLAG') or to store a modified name string in the
    `symbol_ref' (if one bit is not enough information).  */
-#define ENCODE_SECTION_INFO(DECL)  xstormy16_encode_section_info(DECL)
+#define ENCODE_SECTION_INFO(DECL, FIRST) \
+  xstormy16_encode_section_info(DECL, FIRST)
 
 /* Decode SYM_NAME and store the real name part in VAR, sans the characters
    that encode section info.  Define this macro if `ENCODE_SECTION_INFO' alters
index b20c1f48b4d2a2c2dbb8a0518714e360b4577b1b..1cf58da1290bb905ae60abb14f3b989ded4f6711 100644 (file)
@@ -1505,10 +1505,10 @@ extern union tree_node * GHS_current_section_names [(int) COUNT_OF_GHS_SECTION_K
 
 #define EP_REGNUM 30   /* ep register number */
 
-#define ENCODE_SECTION_INFO(DECL)                              \
+#define ENCODE_SECTION_INFO(DECL, FIRST)                       \
   do                                                           \
     {                                                          \
-      if (TREE_CODE (DECL) == VAR_DECL                         \
+      if ((FIRST) && TREE_CODE (DECL) == VAR_DECL              \
           && (TREE_STATIC (DECL) || DECL_EXTERNAL (DECL)))     \
        v850_encode_data_area (DECL);                           \
     }                                                          \
index 133d1c3ba1ab8db60195352f40fb2e3dff149af9..69eced9db1db64ba01bb3165d23e97006e86c8d3 100644 (file)
@@ -88,7 +88,7 @@ Boston, MA 02111-1307, USA.  */
    addressed.  Under VMS there is some brain damage in the linker that requires
    us to do this.  */
 
-#define ENCODE_SECTION_INFO(decl)                              \
+#define ENCODE_SECTION_INFO(decl, FIRST)                       \
   if (DECL_EXTERNAL (decl) && TREE_PUBLIC (decl))              \
     SYMBOL_REF_FLAG (XEXP (DECL_RTL (decl), 0)) = 1; 
 
index 709ed06d110b5029cf5a4810133d5745feee0d2e..428ed4734a42775206f1146c8a91c24b56d367c6 100644 (file)
@@ -1261,7 +1261,7 @@ typedef struct xtensa_args {
 
 /* If we are referencing a function that is static, make the SYMBOL_REF
    special so that we can generate direct calls to it even with -fpic.  */
-#define ENCODE_SECTION_INFO(DECL)                                      \
+#define ENCODE_SECTION_INFO(DECL, FIRST)                               \
   do {                                                                 \
     if (TREE_CODE (DECL) == FUNCTION_DECL && ! TREE_PUBLIC (DECL))     \
       SYMBOL_REF_FLAG (XEXP (DECL_RTL (DECL), 0)) = 1;                 \
index 1a5855740ac0c782036daa1971297b0e927179e5..2d7c3e0f250462e57089530efaa71638a226af46 100644 (file)
@@ -5545,25 +5545,31 @@ readonly data section is used.
 This macro is irrelevant if there is no separate readonly data section.
 
 @findex ENCODE_SECTION_INFO
-@item ENCODE_SECTION_INFO (@var{decl})
+@item ENCODE_SECTION_INFO (@var{decl}, @var{new_decl_p})
 Define this macro if references to a symbol or a constant must be
 treated differently depending on something about the variable or
 function named by the symbol (such as what section it is in).
 
 The macro definition, if any, is executed under two circumstances.  One
 is immediately after the rtl for @var{decl} that represents a variable
-or a function has been created and stored in @code{DECL_RTL
-(@var{decl})}.  The value of the rtl will be a @code{mem} whose address
-is a @code{symbol_ref}.  The other is immediately after the rtl for
-@var{decl} that represents a constant has been created and stored in
-@code{TREE_CST_RTL (@var{decl})}.  The macro is called once for each
-distinct constant in a source file.
+or a function has been created and stored in @code{DECL_RTL(@var{decl})}.
+The value of the rtl will be a @code{mem} whose address is a @code{symbol_ref}.
+The other is immediately after the rtl for @var{decl} that represents a
+constant has been created and stored in @code{TREE_CST_RTL (@var{decl})}.
+The macro is called once for each distinct constant in a source file.
+
+The @var{new_decl_p} argument will be true if this is the first time that
+@code{ENCODE_SECTION_INFO} has been invoked on this decl.  It will
+be false for subsequent invocations, which will happen for duplicate
+declarations.  Whether or not anything must be done for the duplicate
+declaration depends on whether @code{ENCODE_SECTION_INFO} examines
+@code{DECL_ATTRIBUTES}.
 
 @cindex @code{SYMBOL_REF_FLAG}, in @code{ENCODE_SECTION_INFO}
 The usual thing for this macro to do is to record a flag in the
 @code{symbol_ref} (such as @code{SYMBOL_REF_FLAG}) or to store a
-modified name string in the @code{symbol_ref} (if one bit is not enough
-information).
+modified name string in the @code{symbol_ref} (if one bit is not
+enough information).
 
 @findex STRIP_NAME_ENCODING
 @item STRIP_NAME_ENCODING (@var{var}, @var{sym_name})
index e7505a8c39cd93913726cd1f4eea197048eea65b..4d57b8990f82a8c9950faa4c06f398548228a898 100644 (file)
@@ -851,14 +851,11 @@ make_decl_rtl (decl, asmspec)
 
       /* ??? Another way to do this would be to do what halfpic.c does
         and maintain a hashed table of such critters.  */
-      /* ??? Another way to do this would be to pass a flag bit to
-        ENCODE_SECTION_INFO saying whether this is a new decl or not.  */
       /* Let the target reassign the RTL if it wants.
         This is necessary, for example, when one machine specific
         decl attribute overrides another.  */
-#ifdef REDO_SECTION_INFO_P
-      if (REDO_SECTION_INFO_P (decl))
-       ENCODE_SECTION_INFO (decl);
+#ifdef ENCODE_SECTION_INFO
+      ENCODE_SECTION_INFO (decl, false);
 #endif
       return;
     }
@@ -984,7 +981,7 @@ make_decl_rtl (decl, asmspec)
      If the name is changed, the macro ASM_OUTPUT_LABELREF
      will have to know how to strip this information.  */
 #ifdef ENCODE_SECTION_INFO
-  ENCODE_SECTION_INFO (decl);
+  ENCODE_SECTION_INFO (decl, true);
 #endif
 }
 
@@ -3320,7 +3317,7 @@ output_constant_def (exp, defer)
      encoded in it.  */
   if (! found)
     {
-      ENCODE_SECTION_INFO (exp);
+      ENCODE_SECTION_INFO (exp, true);
       desc->rtl = rtl;
       desc->label = XSTR (XEXP (desc->rtl, 0), 0);
     }