compiler: disable escape analysis for runtime
authorIan Lance Taylor <ian@gcc.gnu.org>
Mon, 6 Nov 2017 21:00:32 +0000 (21:00 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Mon, 6 Nov 2017 21:00:32 +0000 (21:00 +0000)
    Currently the runtime is hard-coded to non-escape in various places.
    Don't run escape analysis for runtime.

    Reviewed-on: https://go-review.googlesource.com/76210

From-SVN: r254476

gcc/go/gofrontend/MERGE
gcc/go/gofrontend/escape.cc

index 9168d1fd5b67ccf9098c026b9d0d61041c5ddd86..79ad326e2c4ab38a37600c02a81e4271259768b5 100644 (file)
@@ -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 dea21188c92eef041547033fe06cc144d39037c4..bae8c924b85b2809d037c33067db5bb32e7c459a 100644 (file)
@@ -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();