This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH: Small change to label encoding on PA
- From: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 30 Sep 2002 15:59:20 -0400 (EDT)
- Subject: PATCH: Small change to label encoding on PA
The enclosed patch fixes the failure of asm-names.c on the PA. We
weren't outputing user_label_prefix and hppa_encode_label was dropping
the as is, '*', prefix from the label string.
Tested on hppa-linux and hppa2.0w-hp-hpux11.11. Installed on main.
Dave
--
J. David Anglin dave.anglin@nrc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6605)
2002-09-30 John David Anglin <dave@hiauly1.hia.nrc.ca>
* pa.c (hppa_encode_label): Don't drop '*' from function labels.
(pa_strip_name_encoding): Strip '@' and '*', in that order.
* pa.h (ASM_OUTPUT_LABELREF): Output user_label_prefix except when
there is a '*' prefix in NAME.
Index: config/pa/pa.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/config/pa/pa.c,v
retrieving revision 1.181
diff -u -3 -p -r1.181 pa.c
--- config/pa/pa.c 20 Sep 2002 23:46:57 -0000 1.181
+++ config/pa/pa.c 30 Sep 2002 04:16:15 -0000
@@ -6487,11 +6487,6 @@ hppa_encode_label (sym)
char *newstr, *p;
p = newstr = alloca (len + 1);
- if (str[0] == '*')
- {
- str++;
- len--;
- }
*p++ = '@';
strcpy (p, str);
@@ -6523,7 +6518,9 @@ static const char *
pa_strip_name_encoding (str)
const char *str;
{
- return str + (*str == '*' || *str == '@');
+ str += (*str == '@');
+ str += (*str == '*');
+ return str;
}
int
Index: config/pa/pa.h
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/config/pa/pa.h,v
retrieving revision 1.169
diff -u -3 -p -r1.169 pa.h
--- config/pa/pa.h 24 Sep 2002 12:49:01 -0000 1.169
+++ config/pa/pa.h 30 Sep 2002 04:16:15 -0000
@@ -1688,7 +1688,16 @@ do { \
`assemble_name' uses this. */
#define ASM_OUTPUT_LABELREF(FILE,NAME) \
- fprintf ((FILE), "%s", (NAME) + (FUNCTION_NAME_P (NAME) ? 1 : 0))
+ do { \
+ const char *xname = (NAME); \
+ if (FUNCTION_NAME_P (NAME)) \
+ xname += 1; \
+ if (xname[0] == '*') \
+ xname += 1; \
+ else \
+ fputs (user_label_prefix, FILE); \
+ fputs (xname, FILE); \
+ } while (0)
/* This is how to output an internal numbered label where
PREFIX is the class of label and NUM is the number within the class. */