[FORTRAN,26/29] Use stringpool for mangled common names
diff mbox series

Message ID 20180905145732.404-27-rep.dot.nop@gmail.com
State New
Headers show
Series
  • [FORTRAN,01/29] gdbinit: break on gfc_internal_error
Related show

Commit Message

Bernhard Reutner-Fischer Sept. 5, 2018, 2:57 p.m. UTC
From: Bernhard Reutner-Fischer <aldot@gcc.gnu.org>

gcc/fortran/ChangeLog:

2017-11-29  Bernhard Reutner-Fischer  <aldot@gcc.gnu.org>

	* match.c (gfc_get_common): Use stringpool for mangled name.
---
 gcc/fortran/match.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch
diff mbox series

diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c
index fd91e280b93..8d073f28f67 100644
--- a/gcc/fortran/match.c
+++ b/gcc/fortran/match.c
@@ -5008,13 +5008,13 @@  gfc_get_common (const char *name, int from_module)
 {
   gfc_symtree *st;
   static int serial = 0;
-  char mangled_name[GFC_MAX_SYMBOL_LEN + 1];
+  const char *mangled_name;
 
   if (from_module)
     {
       /* A use associated common block is only needed to correctly layout
 	 the variables it contains.  */
-      snprintf (mangled_name, GFC_MAX_SYMBOL_LEN, "_%d_%s", serial++, name);
+      mangled_name = gfc_get_string ("_%d_%s", serial++, name);
       st = gfc_new_symtree (&gfc_current_ns->common_root, mangled_name);
     }
   else