public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: libgo patch committed: Update to Go1.12beta2
@ 2019-01-22  8:46 Uros Bizjak
  2019-01-22 15:44 ` [gofrontend-dev] " Ian Lance Taylor
  0 siblings, 1 reply; 2+ messages in thread
From: Uros Bizjak @ 2019-01-22  8:46 UTC (permalink / raw)
  To: Ian Taylor; +Cc: gcc-patches, gofrontend-dev

[-- Attachment #1: Type: text/plain, Size: 1369 bytes --]

Hello!

> I have committed a patch to update libgo to the Go 1.12beta2 release.
>
> As usual this sort of update is too large to include all changes in
> this e-mail.  I've included changes to gccgo-specific files below.
>
> Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu.  Committed
> to mainline.

Attached patch is needed to prevent panic on alphaec68-linux-gnu when
building test harness in gotools directory. It substitutes one
instance of hardcoded "gc" with build.Default.Compiler in place where
archSizes are determined. Please note that there are other similar
cases, which don't trigger panics for me, but are suspicious, too:

[uros@localhost golang.org]$ grep -R "\"gc\"" *
x/tools/go/analysis/unitchecker/unitchecker.go:         Sizes:
types.SizesFor("gc", build.Default.GOARCH), // assume gccgo ≡ gc?
x/tools/go/analysis/passes/asmdecl/asmdecl.go:          arch.sizes =
types.SizesFor("gc", arch.name)
x/tools/go/analysis/passes/asmdecl/asmdecl.go:
arch.sizes = types.SizesFor("gc", "amd64")
x/tools/go/analysis/passes/printf/types.go:var archSizes =
types.SizesFor("gc", build.Default.GOARCH)
x/tools/go/analysis/passes/cgocall/cgocall.go:          Sizes:
types.SizesFor("gc", build.Default.GOARCH),

Patch was regression tested on alphaev68-linux-gnu, and fixes a bunch
of panics in gotools directory.

Uros.

[-- Attachment #2: g.diff.txt --]
[-- Type: text/plain, Size: 550 bytes --]

diff --git a/libgo/go/golang.org/x/tools/go/analysis/passes/shift/shift.go b/libgo/go/golang.org/x/tools/go/analysis/passes/shift/shift.go
index 56b150b2b132..beb0b124b0e5 100644
--- a/libgo/go/golang.org/x/tools/go/analysis/passes/shift/shift.go
+++ b/libgo/go/golang.org/x/tools/go/analysis/passes/shift/shift.go
@@ -125,4 +125,4 @@ var (
 	uintptrBitSize = 8 * archSizes.Sizeof(types.Typ[types.Uintptr])
 )
 
-var archSizes = types.SizesFor("gc", build.Default.GOARCH)
+var archSizes = types.SizesFor(build.Default.Compiler, build.Default.GOARCH)

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [gofrontend-dev] Re: libgo patch committed: Update to Go1.12beta2
  2019-01-22  8:46 libgo patch committed: Update to Go1.12beta2 Uros Bizjak
@ 2019-01-22 15:44 ` Ian Lance Taylor
  0 siblings, 0 replies; 2+ messages in thread
From: Ian Lance Taylor @ 2019-01-22 15:44 UTC (permalink / raw)
  To: Uros Bizjak; +Cc: gcc-patches, gofrontend-dev

[-- Attachment #1: Type: text/plain, Size: 1666 bytes --]

On Tue, Jan 22, 2019 at 12:46 AM Uros Bizjak <ubizjak@gmail.com> wrote:
>
> > I have committed a patch to update libgo to the Go 1.12beta2 release.
> >
> > As usual this sort of update is too large to include all changes in
> > this e-mail.  I've included changes to gccgo-specific files below.
> >
> > Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu.  Committed
> > to mainline.
>
> Attached patch is needed to prevent panic on alphaec68-linux-gnu when
> building test harness in gotools directory. It substitutes one
> instance of hardcoded "gc" with build.Default.Compiler in place where
> archSizes are determined. Please note that there are other similar
> cases, which don't trigger panics for me, but are suspicious, too:
>
> [uros@localhost golang.org]$ grep -R "\"gc\"" *
> x/tools/go/analysis/unitchecker/unitchecker.go:         Sizes:
> types.SizesFor("gc", build.Default.GOARCH), // assume gccgo ≡ gc?
> x/tools/go/analysis/passes/asmdecl/asmdecl.go:          arch.sizes =
> types.SizesFor("gc", arch.name)
> x/tools/go/analysis/passes/asmdecl/asmdecl.go:
> arch.sizes = types.SizesFor("gc", "amd64")
> x/tools/go/analysis/passes/printf/types.go:var archSizes =
> types.SizesFor("gc", build.Default.GOARCH)
> x/tools/go/analysis/passes/cgocall/cgocall.go:          Sizes:
> types.SizesFor("gc", build.Default.GOARCH),
>
> Patch was regression tested on alphaev68-linux-gnu, and fixes a bunch
> of panics in gotools directory.

Thanks.  I committed the larger change to mainline, as follows.

This updates all the calls, except for the one in the asmdecl pass,
which is not applicable to gccgo anyhow.

Ian

[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 2779 bytes --]

Index: gcc/go/gofrontend/MERGE
===================================================================
--- gcc/go/gofrontend/MERGE	(revision 268131)
+++ gcc/go/gofrontend/MERGE	(working copy)
@@ -1,4 +1,4 @@
-fb44f62e7c01ebc987dad78875f593da18100007
+e3271f3e09337b951822ba5c596d8cfe3b94508e
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
Index: libgo/go/golang.org/x/tools/go/analysis/passes/cgocall/cgocall.go
===================================================================
--- libgo/go/golang.org/x/tools/go/analysis/passes/cgocall/cgocall.go	(revision 268084)
+++ libgo/go/golang.org/x/tools/go/analysis/passes/cgocall/cgocall.go	(working copy)
@@ -271,7 +271,7 @@ func typeCheckCgoSourceFiles(fset *token
 			return importMap[path], nil
 		}),
 		// TODO(adonovan): Sizes should probably be provided by analysis.Pass.
-		Sizes: types.SizesFor("gc", build.Default.GOARCH),
+		Sizes: types.SizesFor("gccgo", build.Default.GOARCH),
 		Error: func(error) {}, // ignore errors (e.g. unused import)
 	}
 
Index: libgo/go/golang.org/x/tools/go/analysis/passes/printf/types.go
===================================================================
--- libgo/go/golang.org/x/tools/go/analysis/passes/printf/types.go	(revision 268084)
+++ libgo/go/golang.org/x/tools/go/analysis/passes/printf/types.go	(working copy)
@@ -236,4 +236,4 @@ func matchStructArgType(pass *analysis.P
 	return true
 }
 
-var archSizes = types.SizesFor("gc", build.Default.GOARCH)
+var archSizes = types.SizesFor("gccgo", build.Default.GOARCH)
Index: libgo/go/golang.org/x/tools/go/analysis/passes/shift/shift.go
===================================================================
--- libgo/go/golang.org/x/tools/go/analysis/passes/shift/shift.go	(revision 268084)
+++ libgo/go/golang.org/x/tools/go/analysis/passes/shift/shift.go	(working copy)
@@ -125,4 +125,4 @@ var (
 	uintptrBitSize = 8 * archSizes.Sizeof(types.Typ[types.Uintptr])
 )
 
-var archSizes = types.SizesFor("gc", build.Default.GOARCH)
+var archSizes = types.SizesFor("gccgo", build.Default.GOARCH)
Index: libgo/go/golang.org/x/tools/go/analysis/unitchecker/unitchecker.go
===================================================================
--- libgo/go/golang.org/x/tools/go/analysis/unitchecker/unitchecker.go	(revision 268084)
+++ libgo/go/golang.org/x/tools/go/analysis/unitchecker/unitchecker.go	(working copy)
@@ -221,7 +221,7 @@ func run(fset *token.FileSet, cfg *Confi
 	})
 	tc := &types.Config{
 		Importer: importer,
-		Sizes:    types.SizesFor("gc", build.Default.GOARCH), // assume gccgo ≡ gc?
+		Sizes:    types.SizesFor("gccgo", build.Default.GOARCH), // assume gccgo ≡ gc?
 	}
 	info := &types.Info{
 		Types:      make(map[ast.Expr]types.TypeAndValue),

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-01-22 15:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-22  8:46 libgo patch committed: Update to Go1.12beta2 Uros Bizjak
2019-01-22 15:44 ` [gofrontend-dev] " 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).