This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Omit AIX mapping class from VAR_DECL


AIX Assembler uses storage mapping classes to map symbols and CSECTs
to XCOFF file sections. References to symbols with a section to be
determined in the future are suppose to use [UA] storage mapping class
for "unclassified".

rs6000.c:rs6000_output_symbol() adds the [DS] decoration for function
symbols and recently added the [UA] decoration for extern data.
rs6000_output_symbol() both emitted the decoration and also changed
the string in the DECL.  For data symbols, this causes a failure in
some of the GCC hashing and comparison routines.

This patch adjusts rs6000_output_symbol() to only modify the DECL for
FUNCTION_DECLs not VAR_DECLs.

Bootstrapped on powrepc-ibm-aix7.1.0.0

* config/rs6000/rs6000.c (rs6000_output_symbol): Don't modify VAR_DECL string.

Index: rs6000.c
===================================================================
--- rs6000.c    (revision 240516)
+++ rs6000.c    (working copy)
@@ -30309,7 +30309,10 @@ rs6000_output_symbol_ref (FILE *file, rtx x)
                     (TREE_CODE (decl) == FUNCTION_DECL
                      ? "[DS]" : "[UA]"),
                     NULL);
-      XSTR (x, 0) = name;
+
+      /* Don't modify name in extern VAR_DECL to include mapping class.  */
+      if (TREE_CODE (decl) == FUNCTION_DECL)
+       XSTR (x, 0) = name;
     }

   if (VTABLE_NAME_P (name))


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]