Until we sort out a reasonable API and implementation for building up label strings, this will have to be sufficient.

As outlined earlier this month, when we build up label names, part of the name is hidden in the backend, part in the caller. As a result there's no good way to get the length and size the array.

sparc uses more characters than any other in-tree port and as a result it could (with sufficient local labels) do an out-of-range write into the name array when building a local label.

This patch increases the buffer by one char which is sufficient to avoid the problem.

Installing on the trunk.

Jeff
commit c348c67f8c305df504e88659eecf0f5c9994618a
Author: law <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Wed Nov 23 22:48:45 2016 +0000

        * varasm.c (assemble_name): Increase buffer size for name.
    
    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@242810 
138bc75d-0d04-0410-961f-82ee72b054a4

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 23f2c16..46b023e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,7 @@
 2016-11-23  Jeff Law  <l...@redhat.com>
 
+       * varasm.c (assemble_name): Increase buffer size for name.
+
        * config/spu/spu.md (floatunsdidf2): Remove unused local variable.
 
 2016-11-23  Jakub Kicinski  <jakub.kicin...@netronome.com>
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 2c238950..2a20f64 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -2547,7 +2547,7 @@ assemble_name (FILE *file, const char *name)
 rtx
 assemble_static_space (unsigned HOST_WIDE_INT size)
 {
-  char name[16];
+  char name[17];
   const char *namestring;
   rtx x;
 

Reply via email to