+2001-11-01 Kazu Hirata <kazu@hxi.com>
+
+ * config/h8300/h8300.c (h8300_encode_label): Compute a string
+ before passing it to ggc_alloc_string.
+
2001-11-01 Kazu Hirata <kazu@hxi.com>
* config/m68k/3b1.h: Fix comment formatting.
{
const char *str = XSTR (XEXP (DECL_RTL (decl), 0), 0);
int len = strlen (str);
- char *newstr;
+ char *newstr = alloca (len + 2);
- newstr = ggc_alloc_string (NULL, len + 1);
+ newstr[0] = '&';
+ strcpy (&newstr[1], str);
- strcpy (newstr + 1, str);
- *newstr = '&';
- XSTR (XEXP (DECL_RTL (decl), 0), 0) = newstr;
+ XSTR (XEXP (DECL_RTL (decl), 0), 0) =
+ ggc_alloc_string (newstr, len + 1);
}
const char *