[multiple changes]
authorDavid Edelsohn <dje@gcc.gnu.org>
Mon, 16 Feb 2015 15:33:09 +0000 (10:33 -0500)
committerDavid Edelsohn <dje@gcc.gnu.org>
Mon, 16 Feb 2015 15:33:09 +0000 (10:33 -0500)
2015-02-16  Michael Haubenwallner  <michael.haubenwallner@ssi-schaefer.com>
            David Edelsohn  <dje.gcc@gmail.com>

        PR target/65058
        * config/rs6000/rs6000.c (rs6000_output_symbol_ref): Append storage
        mapping class to external variable or function reference.
        * config/rs6000/xcoff.h (ASM_OUTPUT_EXTERNAL): Do not append storage
        mapping class.

2015-02-16  David Eelsohn  <dje.gcc@gmail.com>

        PR target/53348
        * config/rs6000/rs6000.c (rs6000_declare_alias): Only use
        ASM_WEAKEN_DECL if defined.

From-SVN: r220737

gcc/ChangeLog
gcc/config/rs6000/rs6000.c
gcc/config/rs6000/xcoff.h

index e049c99a7916be54c7132957c234d2867b776cd3..04ac1192bd1f3a4eff91e91036762dad5f022732 100644 (file)
@@ -1,3 +1,18 @@
+2015-02-16  Michael Haubenwallner  <michael.haubenwallner@ssi-schaefer.com>
+           David Edelsohn  <dje.gcc@gmail.com>
+
+       PR target/65058
+       * config/rs6000/rs6000.c (rs6000_output_symbol_ref): Append storage
+       mapping class to external variable or function reference.
+       * config/rs6000/xcoff.h (ASM_OUTPUT_EXTERNAL): Do not append storage
+       mapping class.
+
+2015-02-16  David Eelsohn  <dje.gcc@gmail.com>
+
+       PR target/53348
+       * config/rs6000/rs6000.c (rs6000_declare_alias): Only use
+       ASM_WEAKEN_DECL if defined.
+
 2015-02-16  Richard Biener  <rguenther@suse.de>
 
        PR lto/65015
index 86ef0fe0fc61316a9bd9a688a6aa03b86f806462..e482547aecc09e55cd5c19fbd76ef6501e5d861d 100644 (file)
@@ -26030,6 +26030,20 @@ rs6000_output_symbol_ref (FILE *file, rtx x)
      section.  */
   const char *name = XSTR (x, 0);
 
+  tree decl = SYMBOL_REF_DECL (x);
+  if (decl /* sync condition with assemble_external () */
+      && DECL_P (decl) && DECL_EXTERNAL (decl) && TREE_PUBLIC (decl)
+      && (TREE_CODE (decl) == VAR_DECL
+         || TREE_CODE (decl) == FUNCTION_DECL)
+      && name[strlen (name) - 1] != ']')
+    {
+      name = concat (name,
+                    (TREE_CODE (decl) == FUNCTION_DECL
+                     ? "[DS]" : "[UA]"),
+                    NULL);
+      XSTR (x, 0) = name;
+    }
+
   if (VTABLE_NAME_P (name))
     {
       RS6000_OUTPUT_BASENAME (file, name);
@@ -30081,8 +30095,10 @@ rs6000_declare_alias (struct symtab_node *n, void *d)
          RS6000_OUTPUT_BASENAME (data->file, buffer);
          putc ('\n', data->file);
        }
+#ifdef ASM_WEAKEN_DECL
       else if (DECL_WEAK (n->decl) && !data->function_descriptor)
        ASM_WEAKEN_DECL (data->file, n->decl, name, NULL);
+#endif
     }
   else
     {
index 6dc1207aba81a327f7e5e73b967e3eac9caa7cab..db024fcaceeea40d5de2ee2845a30b3481fcd855 100644 (file)
       putc ('\n', FILE);                                               \
       fprintf(FILE, "\t.rename .%s,\".%s\"\n", buffer, NAME);          \
     }                                                                  \
-  if ((TREE_CODE (DECL) == VAR_DECL                                    \
-       || TREE_CODE (DECL) == FUNCTION_DECL)                           \
-      && (NAME)[strlen (NAME) - 1] != ']')                             \
-    {                                                                  \
-      XSTR (_symref, 0) = concat (XSTR (_symref, 0),                   \
-                                 (TREE_CODE (DECL) == FUNCTION_DECL    \
-                                  ? "[DS]" : "[RW]"),                  \
-                                 NULL);                                \
-    }                                                                  \
 }
 
 /* This is how to output a reference to a user-level label named NAME.