public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix PR target/15178
@ 2004-06-09 17:57 Jakub Jelinek
  0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2004-06-09 17:57 UTC (permalink / raw)
  To: gcc-patches

Hi!

PR target/15178 suggests that Solaris as makes an alias global even without
.global directive, probably as long as the symbol it is aliased to is global
or something.
The PR also claims .local directive fixes this up and that the following
patch fixes the issue (don't have Solaris/x86 myself, so cannot verify it).
With this patch, all .set x, y directives should be accompanied by either
.global x (GCC already does this) or .local x on Solaris/x86.
Ok for HEAD/3.4?

2004-06-09  Jakub Jelinek  <jakub@redhat.com>

	PR target/15178
	* config/i386/sol2.h (ASM_OUTPUT_DEF_FROM_DECLS): Define.

--- gcc/config/i386/sol2.h.jj	2004-06-09 15:49:22.721059407 +0200
+++ gcc/config/i386/sol2.h	2004-06-09 15:57:02.716622213 +0200
@@ -64,3 +64,18 @@ Boston, MA 02111-1307, USA.  */
 
 /* The Solaris assembler does not support .quad.  Do not use it.  */
 #undef ASM_QUAD
+
+/* The Solaris assembler wants a .local for non-exported aliases.  */
+#define ASM_OUTPUT_DEF_FROM_DECLS(FILE, DECL, TARGET)	\
+  do {							\
+    const char *declname =				\
+      IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (DECL));	\
+    ASM_OUTPUT_DEF ((FILE), declname,			\
+		    IDENTIFIER_POINTER (TARGET));	\
+    if (! TREE_PUBLIC (DECL))				\
+      {							\
+	fprintf ((FILE), "%s", LOCAL_ASM_OP);		\
+	assemble_name ((FILE), declname);		\
+	fprintf ((FILE), "\n");				\
+      }							\
+  } while (0)

	Jakub

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-06-09 16:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-09 17:57 [PATCH] Fix PR target/15178 Jakub Jelinek

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).