This patch from Chris Manghane marks variables whose address is not
taken as not escaping.  This is needed because for some types there
are ways for the variable to escape even without taking its address.
Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu.
Committed to mainline.

Ian
diff -r c8ad01075b29 go/escape.cc
--- a/go/escape.cc      Wed Apr 29 15:39:43 2015 -0700
+++ b/go/escape.cc      Thu Apr 30 10:20:47 2015 -0700
@@ -1560,8 +1560,7 @@
 
   if (var->is_variable())
     {
-      if (var->var_value()->is_address_taken())
-       var->var_value()->set_does_not_escape();
+      var->var_value()->set_does_not_escape();
       if (var->var_value()->init() != NULL
          && var->var_value()->init()->allocation_expression() != NULL)
        {
@@ -1570,9 +1569,6 @@
          alloc->set_allocate_on_stack();
        }
     }
-  else if (var->is_result_variable()
-          && var->result_var_value()->is_address_taken())
-    var->result_var_value()->set_does_not_escape();
 
   return TRAVERSE_CONTINUE;
 }

Reply via email to