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]

[committed] Fix label ouput on PA when using HP assembler


In the development of 4.0, the method of outputing internal labels
changed.  This caused resulted in the default mechanism being used
to output internal labels when using the HP assembler.  The default
provides labels terminated with a colon.  However, the HP assembler
doesn't like labels with colons.  Unfortunately, this wasn't noticed
until I did some recent tests building with the HP assembler.

The enclosed patch changes the output of labels on the PA to use
a colon with the GNU assembler and no colon with the HP assembler.

Tested on hppa2.0w-hp-hpux11.11, hppa64-hp-hpux11.11 and
hppa-unknown-linux-gnu.

Committed to 4.0, 4.1, 4.2 and trunk.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)

2007-01-11  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>

	* pa-linux.h (ASM_OUTPUT_INTERNAL_LABEL): Undefine.
	* pa.h (ASM_OUTPUT_LABEL): Output colon when using GAS.
	(ASM_OUTPUT_INTERNAL_LABEL): Define.

Index: config/pa/pa-linux.h
===================================================================
--- config/pa/pa-linux.h	(revision 120653)
+++ config/pa/pa-linux.h	(working copy)
@@ -106,6 +106,9 @@
    ASM_GENERATE_INTERNAL_LABEL(), so do not define it here.  */
 
 /* Use the default.  */
+#undef ASM_OUTPUT_INTERNAL_LABEL
+
+/* Use the default.  */
 #undef TARGET_ASM_GLOBALIZE_LABEL
 /* Globalizing directive for a label.  */
 #define GLOBAL_ASM_OP ".globl "
Index: config/pa/pa.h
===================================================================
--- config/pa/pa.h	(revision 120653)
+++ config/pa/pa.h	(working copy)
@@ -1742,9 +1742,14 @@
 /* This is how to output the definition of a user-level label named NAME,
    such as the label on a static function or variable NAME.  */
 
-#define ASM_OUTPUT_LABEL(FILE, NAME)	\
-  do { assemble_name (FILE, NAME); 	\
-       fputc ('\n', FILE); } while (0)
+#define ASM_OUTPUT_LABEL(FILE,NAME) \
+  do {							\
+    assemble_name ((FILE), (NAME));			\
+    if (TARGET_GAS)					\
+      fputs (":\n", (FILE));				\
+    else						\
+      fputc ('\n', (FILE));				\
+  } while (0)
 
 /* This is how to output a reference to a user-level label named NAME.
    `assemble_name' uses this.  */
@@ -1777,6 +1782,17 @@
 #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM)	\
   sprintf (LABEL, "*%c$%s%04ld", (PREFIX)[0], (PREFIX) + 1, (long)(NUM))
 
+/* Output the definition of a compiler-generated label named NAME.  */
+
+#define ASM_OUTPUT_INTERNAL_LABEL(FILE,NAME) \
+  do {							\
+    assemble_name_raw ((FILE), (NAME));			\
+    if (TARGET_GAS)					\
+      fputs (":\n", (FILE));				\
+    else						\
+      fputc ('\n', (FILE));				\
+  } while (0)
+
 #define TARGET_ASM_GLOBALIZE_LABEL pa_globalize_label
 
 #define ASM_OUTPUT_ASCII(FILE, P, SIZE)  \


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