Go patch committed: Handle unsafe conversions in escape analysis

Message ID CAOyqgcVhS=4winuCQM1SgabM9JJ1GJKVGjKFE=aE+9gKW400TQ@mail.gmail.com
State New
Headers show
Series
  • Go patch committed: Handle unsafe conversions in escape analysis
Related show

Commit Message

Ian Lance Taylor Aug. 28, 2019, 6:45 p.m.
This patch to the Go frontend by Cherry Zhang handles unsafe
conversion expression in escape analysis.  Previously escape analysis
never saw these, but now it does for the case of a map assignment.
Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu.  Committed
to mainline.

Ian

Patch

Index: gcc/go/gofrontend/MERGE
===================================================================
--- gcc/go/gofrontend/MERGE	(revision 274998)
+++ gcc/go/gofrontend/MERGE	(working copy)
@@ -1,4 +1,4 @@ 
-189ff44b2c26f29f41f0eb159e0d8f3fa508ecae
+5d15923ada640befb236d5fe94f0c724e98e99d7
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
Index: gcc/go/gofrontend/escape.cc
===================================================================
--- gcc/go/gofrontend/escape.cc	(revision 274169)
+++ gcc/go/gofrontend/escape.cc	(working copy)
@@ -1706,6 +1706,15 @@  Escape_analysis_assign::expression(Expre
       }
       break;
 
+    case Expression::EXPRESSION_UNSAFE_CONVERSION:
+      {
+        Unsafe_type_conversion_expression* uce =
+          (*pexpr)->unsafe_conversion_expression();
+        Node* expr_node = Node::make_node(uce->expr());
+        this->assign(n, expr_node);
+      }
+      break;
+
     case Expression::EXPRESSION_FIXED_ARRAY_CONSTRUCTION:
     case Expression::EXPRESSION_SLICE_CONSTRUCTION:
       {