rs6000.c (rs6000_encode_section_info): If ggc_p, use ggc_alloc_string.

* rs6000.c (rs6000_encode_section_info): If ggc_p, use
        ggc_alloc_string.

From-SVN: r29712
This commit is contained in:
Richard Henderson 1999-09-29 16:05:46 -07:00 committed by Richard Henderson
parent 0a2c2fd1c2
commit ff669a6ce0
2 changed files with 28 additions and 8 deletions

View File

@ -1,3 +1,8 @@
Wed Sep 29 16:05:18 1999 Richard Henderson <rth@cygnus.com>
* rs6000.c (rs6000_encode_section_info): If ggc_p, use
ggc_alloc_string.
Tue Sep 28 16:45:40 1999 David Edelsohn <edelsohn@gnu.org>
* xcoffout.c (xcoffout_declare_function): Add documentation.

View File

@ -5993,11 +5993,19 @@ rs6000_encode_section_info (decl)
if (DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_NT)
{
const char *prefix = (DEFAULT_ABI == ABI_AIX) ? "." : "..";
char *str = permalloc (strlen (prefix) + 1
+ strlen (XSTR (sym_ref, 0)));
strcpy (str, prefix);
strcat (str, XSTR (sym_ref, 0));
size_t len1 = (DEFAULT_ABI == ABI_AIX) ? 1 : 2;
size_t len2 = strlen (XSTR (sym_ref, 0));
char *str;
if (ggc_p)
str = ggc_alloc_string (NULL, len1 + len2);
else
str = permalloc (len1 + len2 + 1);
str[0] = '.';
str[1] = '.';
memcpy (str + len1, XSTR (sym_ref, 0), len2 + 1);
XSTR (sym_ref, 0) = str;
}
}
@ -6037,9 +6045,16 @@ rs6000_encode_section_info (decl)
&& strcmp (name, ".PPC.EMB.sbss0") == 0))))
{
rtx sym_ref = XEXP (DECL_RTL (decl), 0);
char *str = permalloc (2 + strlen (XSTR (sym_ref, 0)));
strcpy (str, "@");
strcat (str, XSTR (sym_ref, 0));
size_t len = strlen (XSTR (sym_ref, 0));
char *str;
if (ggc_p)
str = ggc_alloc_string (NULL, len + 1);
else
str = permalloc (len + 2);
str[0] = '@';
memcpy (str + 1, XSTR (sym_ref, 0), len + 1);
XSTR (sym_ref, 0) = str;
}
}