public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-7218] compiler: don't set ptrmask bit for pointer to notinheap type
@ 2022-02-13 18:54 Ian Lance Taylor
  0 siblings, 0 replies; only message in thread
From: Ian Lance Taylor @ 2022-02-13 18:54 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:033ec967ec5583ea978d16ca83f9563c518e6dc6

commit r12-7218-g033ec967ec5583ea978d16ca83f9563c518e6dc6
Author: Ian Lance Taylor <iant@golang.org>
Date:   Sat Feb 12 14:54:21 2022 -0800

    compiler: don't set ptrmask bit for pointer to notinheap type
    
    Test case is https://go.dev/cl/385454.
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/385474

Diff:
---
 gcc/go/gofrontend/MERGE    | 2 +-
 gcc/go/gofrontend/types.cc | 9 +++------
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE
index 4e6bac7b7d5..02a6e1d661d 100644
--- a/gcc/go/gofrontend/MERGE
+++ b/gcc/go/gofrontend/MERGE
@@ -1,4 +1,4 @@
-47380f733ca932384e59492d2f04374edd8ec95e
+7f8fee099d6de4a5a857765e0ddfae356ead554c
 
 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/types.cc b/gcc/go/gofrontend/types.cc
index ee3467666d8..8267f1565ce 100644
--- a/gcc/go/gofrontend/types.cc
+++ b/gcc/go/gofrontend/types.cc
@@ -2816,6 +2816,9 @@ class Ptrmask
 void
 Ptrmask::set_from(Gogo* gogo, Type* type, int64_t ptrsize, int64_t offset)
 {
+  if (!type->has_pointer())
+    return;
+
   switch (type->base()->classification())
     {
     default:
@@ -2858,9 +2861,6 @@ Ptrmask::set_from(Gogo* gogo, Type* type, int64_t ptrsize, int64_t offset)
 
     case Type::TYPE_STRUCT:
       {
-	if (!type->has_pointer())
-	  return;
-
 	const Struct_field_list* fields = type->struct_type()->fields();
 	int64_t soffset = 0;
 	for (Struct_field_list::const_iterator pf = fields->begin();
@@ -2898,9 +2898,6 @@ Ptrmask::set_from(Gogo* gogo, Type* type, int64_t ptrsize, int64_t offset)
 	}
       else
 	{
-	  if (!type->has_pointer())
-	    return;
-
 	  int64_t len;
 	  if (!type->array_type()->int_length(&len))
 	    {


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

only message in thread, other threads:[~2022-02-13 18:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-13 18:54 [gcc r12-7218] compiler: don't set ptrmask bit for pointer to notinheap type 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).