]> Cypherpunks.ru repositories - gostls13.git/commitdiff
cmd/compile: remove I-saw-a-register-pragma chatter
authorDavid Chase <drchase@google.com>
Thu, 4 Mar 2021 21:38:20 +0000 (16:38 -0500)
committerDavid Chase <drchase@google.com>
Thu, 4 Mar 2021 21:47:26 +0000 (21:47 +0000)
It is not multithreaded-compilation-safe, and also seems
to cause problems on the noopt-builder.

Change-Id: I52dbcd507d256990f1ec7c8040ec7b76595aae4f
Reviewed-on: https://go-review.googlesource.com/c/go/+/298850
Trust: David Chase <drchase@google.com>
Run-TryBot: David Chase <drchase@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/cmd/compile/internal/ssagen/ssa.go
test/abi/regabipragma.dir/main.go [deleted file]
test/abi/regabipragma.dir/tmp/foo.go [deleted file]
test/abi/regabipragma.go [deleted file]
test/abi/regabipragma.out [deleted file]

index 2a281860af3e8c8f107a2db75279f9f9cfc4528c..881fdcc8f4beaef52f1df2529cd68b7f75531820 100644 (file)
@@ -230,7 +230,6 @@ func abiForFunc(fn *ir.Func, abi0, abi1 *abi.ABIConfig) *abi.ABIConfig {
                        base.ErrorfAt(fn.Pos(), "Calls to //go:registerparams method %s won't work, remove the pragma from the declaration.", name)
                }
                a = abi1
-               base.WarnfAt(fn.Pos(), "declared function %v has register params", fn)
        }
        return a
 }
@@ -4850,9 +4849,6 @@ func (s *state) call(n *ir.CallExpr, k callKind, returnResultAddr bool) *ssa.Val
                        inRegistersImported := fn.Pragma()&ir.RegisterParams != 0
                        inRegistersSamePackage := fn.Func != nil && fn.Func.Pragma&ir.RegisterParams != 0
                        inRegisters = inRegistersImported || inRegistersSamePackage
-                       if inRegisters {
-                               s.f.Warnl(n.Pos(), "called function %v has register params", callee)
-                       }
                        break
                }
                closure = s.expr(fn)
diff --git a/test/abi/regabipragma.dir/main.go b/test/abi/regabipragma.dir/main.go
deleted file mode 100644 (file)
index d663337..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright 2021 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package main
-
-import (
-       "fmt"
-       "regabipragma.dir/tmp"
-)
-
-type S string
-
-//go:noinline
-func (s S) ff(t string) string {
-       return string(s) + " " + t
-}
-
-//go:noinline
-//go:registerparams
-func f(s,t string) string { // ERROR "Declared function f has register params"
-       return s + " " + t
-}
-
-func check(s string) {
-       if s != "Hello world!" {
-               fmt.Printf("FAIL, wanted 'Hello world!' but got '%s'\n", s)
-       }
-}
-
-func main() {
-       check(f("Hello", "world!"))   // ERROR "Called function ...f has register params"
-       check(tmp.F("Hello", "world!"))  // ERROR "Called function regabipragma.dir/tmp.F has register params"
-       check(S("Hello").ff("world!"))
-       check(tmp.S("Hello").FF("world!"))
-}
diff --git a/test/abi/regabipragma.dir/tmp/foo.go b/test/abi/regabipragma.dir/tmp/foo.go
deleted file mode 100644 (file)
index cff989b..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright 2021 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package tmp
-
-
-type S string
-
-//go:noinline
-func (s S) FF(t string) string {
-        return string(s) + " " + t
-}
-
-//go:noinline
-//go:registerparams
-func F(s,t string) string {
-        return s + " " + t
-}
diff --git a/test/abi/regabipragma.go b/test/abi/regabipragma.go
deleted file mode 100644 (file)
index 070b311..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-// skip
-// runindir -gcflags=-c=1
-//go:build !windows
-// +build !windows
-
-// Copyright 2021 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// TODO(register args) Temporarily disabled now that register abi info is flowing halfway through the compiler.
-// TODO(register args) May delete or adapt this test once regabi is the default
-
-package ignore
diff --git a/test/abi/regabipragma.out b/test/abi/regabipragma.out
deleted file mode 100644 (file)
index 321b1ad..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-# regabipragma.dir/tmp
-tmp/foo.go:17:6: declared function F has register params
-# regabipragma.dir
-./main.go:21:6: declared function f has register params
-./main.go:32:9: called function f has register params
-./main.go:33:13: called function tmp.F has register params