public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-2792] compiler: make escape analysis more strict about runtime calls
@ 2021-08-06 19:38 Ian Lance Taylor
  0 siblings, 0 replies; only message in thread
From: Ian Lance Taylor @ 2021-08-06 19:38 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:629b5699fb555b30c25ebc0b503e87b470bed076

commit r12-2792-g629b5699fb555b30c25ebc0b503e87b470bed076
Author: Cherry Mui <cherryyz@google.com>
Date:   Fri Aug 6 11:03:47 2021 -0400

    compiler: make escape analysis more strict about runtime calls
    
    Following the previous CL, in the escape analysis list all the
    expected runtime calls, and fail if an unexpected one is seen.
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/340397

Diff:
---
 gcc/go/gofrontend/MERGE     |  2 +-
 gcc/go/gofrontend/escape.cc | 47 ++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 47 insertions(+), 2 deletions(-)

diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE
index 19ab2de5c18..9ed527f7eb4 100644
--- a/gcc/go/gofrontend/MERGE
+++ b/gcc/go/gofrontend/MERGE
@@ -1,4 +1,4 @@
-32590102c464679f845667b5554e1dcce2549ad2
+747f3a2d78c073e9b03dd81914d0edb7ddc5be14
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
diff --git a/gcc/go/gofrontend/escape.cc b/gcc/go/gofrontend/escape.cc
index c8978ac9239..6da29edc419 100644
--- a/gcc/go/gofrontend/escape.cc
+++ b/gcc/go/gofrontend/escape.cc
@@ -1646,6 +1646,7 @@ Escape_analysis_assign::expression(Expression** pexpr)
 	      case Runtime::MAKECHAN:
 	      case Runtime::MAKECHAN64:
 	      case Runtime::MAKEMAP:
+	      case Runtime::MAKEMAP64:
 	      case Runtime::MAKESLICE:
 	      case Runtime::MAKESLICE64:
                 this->context_->track(n);
@@ -1705,8 +1706,52 @@ Escape_analysis_assign::expression(Expression** pexpr)
                 }
                 break;
 
+              case Runtime::MEMCMP:
+              case Runtime::DECODERUNE:
+              case Runtime::INTSTRING:
+              case Runtime::MAKEMAP_SMALL:
+              case Runtime::MAPACCESS1:
+              case Runtime::MAPACCESS1_FAST32:
+              case Runtime::MAPACCESS1_FAST64:
+              case Runtime::MAPACCESS1_FASTSTR:
+              case Runtime::MAPACCESS1_FAT:
+              case Runtime::MAPACCESS2:
+              case Runtime::MAPACCESS2_FAST32:
+              case Runtime::MAPACCESS2_FAST64:
+              case Runtime::MAPACCESS2_FASTSTR:
+              case Runtime::MAPACCESS2_FAT:
+              case Runtime::MAPASSIGN_FAST32:
+              case Runtime::MAPASSIGN_FAST64:
+              case Runtime::MAPITERINIT:
+              case Runtime::MAPITERNEXT:
+              case Runtime::MAPCLEAR:
+              case Runtime::CHANRECV2:
+              case Runtime::SELECTGO:
+              case Runtime::SELECTNBSEND:
+              case Runtime::SELECTNBRECV:
+              case Runtime::BLOCK:
+              case Runtime::IFACET2IP:
+              case Runtime::EQTYPE:
+              case Runtime::MEMCLRHASPTR:
+              case Runtime::FIELDTRACK:
+              case Runtime::BUILTIN_MEMSET:
+              case Runtime::PANIC_SLICE_CONVERT:
+                // these do not escape.
+                break;
+
+              case Runtime::IFACEE2E2:
+              case Runtime::IFACEI2E2:
+              case Runtime::IFACEE2I2:
+              case Runtime::IFACEI2I2:
+              case Runtime::IFACEE2T2P:
+              case Runtime::IFACEI2T2P:
+                // handled in ::assign.
+                break;
+
 	      default:
-		break;
+                // should not see other runtime calls. they are not yet
+                // lowered to runtime calls at this point.
+                go_unreachable();
 	      }
 	  }
         else


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-08-06 19:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-06 19:38 [gcc r12-2792] compiler: make escape analysis more strict about runtime calls Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).