bootstrap-asan failed on wide-int from what looks like a typo in
compute_ltrans_boundary.  The first loop uses the function-wide "node"
variable while the second loop uses a local "vnode" variable.  The problem
was that the second loop also had a reference to "node".

The patch below gets me past the boostrap failure on x86_64-linux-gnu.
OK to install?

Thanks,
Richard


gcc/
        * lto-cgraph.c (compute_ltrans_boundary): Make node variables local
        to their respective blocks.  Fix inadvertent use of "node".

Index: gcc/lto-cgraph.c
===================================================================
--- gcc/lto-cgraph.c    2014-04-28 15:33:50.239606407 +0100
+++ gcc/lto-cgraph.c    2014-05-01 15:39:42.317120147 +0100
@@ -770,7 +770,6 @@ add_references (lto_symtab_encoder_t enc
 lto_symtab_encoder_t 
 compute_ltrans_boundary (lto_symtab_encoder_t in_encoder)
 {
-  struct cgraph_node *node;
   struct cgraph_edge *edge;
   int i;
   lto_symtab_encoder_t encoder;
@@ -785,7 +784,7 @@ compute_ltrans_boundary (lto_symtab_enco
   for (lsei = lsei_start_function_in_partition (in_encoder);
        !lsei_end_p (lsei); lsei_next_function_in_partition (&lsei))
     {
-      node = lsei_cgraph_node (lsei);
+      struct cgraph_node *node = lsei_cgraph_node (lsei);
       add_node_to (encoder, node, true);
       lto_set_symtab_encoder_in_partition (encoder, node);
       add_references (encoder, &node->ref_list);
@@ -809,7 +808,7 @@ compute_ltrans_boundary (lto_symtab_enco
       if (DECL_ABSTRACT_ORIGIN (vnode->decl))
        {
          varpool_node *origin_node
-         = varpool_get_node (DECL_ABSTRACT_ORIGIN (node->decl));
+           = varpool_get_node (DECL_ABSTRACT_ORIGIN (vnode->decl));
          lto_set_symtab_encoder_in_partition (encoder, origin_node);
        }
     }
@@ -836,7 +835,7 @@ compute_ltrans_boundary (lto_symtab_enco
   for (lsei = lsei_start_function_in_partition (encoder);
        !lsei_end_p (lsei); lsei_next_function_in_partition (&lsei))
     {
-      node = lsei_cgraph_node (lsei);
+      struct cgraph_node *node = lsei_cgraph_node (lsei);
       for (edge = node->callees; edge; edge = edge->next_callee)
        {
          struct cgraph_node *callee = edge->callee;

Reply via email to