diff mbox series

Go patch committed: Disable escape analysis for the runtime package.

Message ID CAOyqgcX-whBtOThLX4U+g9Ub4O2PagZBOcR0gyqAXF20oguf9g@mail.gmail.com
State New
Headers show
Series Go patch committed: Disable escape analysis for the runtime package. | expand

Commit Message

Ian Lance Taylor Nov. 6, 2017, 9 p.m. UTC
This patch by Cherry Zhang disables escape analysis when compiling the
runtime package.  Currently the runtime is hard-coded to non-escape in
various places anyhow, and the compiler's escape analysis breaks this.
Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu.  Committed
to mainline.

Ian
diff mbox series

Patch

Index: gcc/go/gofrontend/MERGE
===================================================================
--- gcc/go/gofrontend/MERGE	(revision 254475)
+++ gcc/go/gofrontend/MERGE	(working copy)
@@ -1,4 +1,4 @@ 
-b9885a251ae2c43252926dbe1960df5640aa469b
+1427cedcb0faa627fd89a75e009f7898c25aa86c
 
 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 254090)
+++ gcc/go/gofrontend/escape.cc	(working copy)
@@ -692,6 +692,12 @@  Gogo::analyze_escape()
   if (!optimize_allocation_flag.is_enabled() || saw_errors())
     return;
 
+  // Currently runtime is hard-coded to non-escape in various places.
+  // Don't run escape analysis for runtime.
+  // TODO: remove this once it works for runtime.
+  if (this->compiling_runtime() && this->package_name() == "runtime")
+    return;
+
   // Discover strongly connected groups of functions to analyze for escape
   // information in this package.
   this->discover_analysis_sets();