http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53093

--- Comment #2 from Jan Hubicka <hubicka at ucw dot cz> 2012-04-25 17:06:41 UTC 
---
Hi,
the problem seems to be quite easy.  We have variable and alias.
The code first counts number of variables and allocated vectors, then it
inserts
aliases, too, and the length of vector is not enough anymore.

Can you, please, test the following patch?  I will try to work out why this
did not ICE before.

Honza

Index: tree-emutls.c
===================================================================
--- tree-emutls.c       (revision 186831)
+++ tree-emutls.c       (working copy)
@@ -706,7 +706,7 @@ create_emultls_var (struct varpool_node 
   cdecl = new_emutls_decl (var->symbol.decl, var->alias_of);

   cvar = varpool_get_node (cdecl);
-  VEC_quick_push (varpool_node_ptr, control_vars, cvar);
+  VEC_safe_push (varpool_node_ptr, heap, control_vars, cvar);

   if (!var->alias)
     {

Reply via email to