public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH PR target/65058] AIX: missing extern decorations "[DS]" for functions and "[RW]" for variables
@ 2015-02-13 22:02 Michael Haubenwallner
  2015-02-14 21:05 ` David Edelsohn
  2015-02-24 21:52 ` Michael Haubenwallner
  0 siblings, 2 replies; 7+ messages in thread
From: Michael Haubenwallner @ 2015-02-13 22:02 UTC (permalink / raw)
  To: GCC Patches; +Cc: David Edelsohn

[-- Attachment #1: Type: text/plain, Size: 114 bytes --]

Hi David,

this is the patch I'm currently testing with gcc-4.8.4 for
http://gcc.gnu.org/PR65058

Thanks!
/haubi/

[-- Attachment #2: 0001-Fix-decorating-referenced-externals-for-xcoff.patch --]
[-- Type: text/x-patch, Size: 2248 bytes --]

From 0f5003fb25608cdae53445777e6a13fec3fbfffc Mon Sep 17 00:00:00 2001
From: Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com>
Date: Fri, 13 Feb 2015 19:26:27 +0100
Subject: [PATCH 1/5] Fix decorating referenced externals for xcoff.

2015-02-13  Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com>

	PR target/65058
	* config/rs6000/rs6000.c: (rs6000_output_symbol_ref) Decorate
	referenced external variable or function accordingly.
	* config/rs6000/xcoff.h: (ASM_OUTPUT_EXTERNAL) Stop decorating
	referenced variable or function.
---
 gcc/config/rs6000/rs6000.c | 13 +++++++++++++
 gcc/config/rs6000/xcoff.h  |  9 ---------
 2 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 86ef0fe..15dd25f 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -26030,6 +26030,19 @@ 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]" : "[RW]"),
+		     NULL);
+      XSTR (x, 0) = name;
+    }									\
   if (VTABLE_NAME_P (name))
     {
       RS6000_OUTPUT_BASENAME (file, name);
diff --git a/gcc/config/rs6000/xcoff.h b/gcc/config/rs6000/xcoff.h
index 6dc1207..db024fc 100644
--- a/gcc/config/rs6000/xcoff.h
+++ b/gcc/config/rs6000/xcoff.h
@@ -170,15 +170,6 @@
       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.
-- 
2.0.5


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-02-24 21:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-13 22:02 [PATCH PR target/65058] AIX: missing extern decorations "[DS]" for functions and "[RW]" for variables Michael Haubenwallner
2015-02-14 21:05 ` David Edelsohn
2015-02-17  7:33   ` Michael Haubenwallner
2015-02-17 15:00     ` David Edelsohn
2015-02-17 16:39       ` Michael Haubenwallner
2015-02-17 17:28         ` David Edelsohn
2015-02-24 21:52 ` Michael Haubenwallner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).