mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
Revert "cmd/compile: allow more args in StructMake folding rule"
This reverts commit 72e8237cc1 (CL 693615)
Reason for revert: still causing compiler failures on Google test code
Change-Id: I4a7850c321d95ed7803d56866bb0c524c7a377d3
Reviewed-on: https://go-review.googlesource.com/c/go/+/695015
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Keith Randall <khr@google.com>
This commit is contained in:
parent
caf9fc3ccd
commit
7248995b60
3 changed files with 3 additions and 28 deletions
|
|
@ -921,7 +921,7 @@
|
|||
@x.Block (Load <v.Type> (OffPtr <v.Type.PtrTo()> [t.FieldOff(int(i))] ptr) mem)
|
||||
|
||||
// Putting struct{*byte} and similar into direct interfaces.
|
||||
(IMake _typ (StructMake ___)) => imakeOfStructMake(v)
|
||||
(IMake _typ (StructMake val)) => imakeOfStructMake(v)
|
||||
(StructSelect [_] (IData x)) => (IData x)
|
||||
|
||||
// un-SSAable values use mem->mem copies
|
||||
|
|
|
|||
|
|
@ -11200,10 +11200,10 @@ func rewriteValuegeneric_OpFloor(v *Value) bool {
|
|||
func rewriteValuegeneric_OpIMake(v *Value) bool {
|
||||
v_1 := v.Args[1]
|
||||
v_0 := v.Args[0]
|
||||
// match: (IMake _typ (StructMake ___))
|
||||
// match: (IMake _typ (StructMake val))
|
||||
// result: imakeOfStructMake(v)
|
||||
for {
|
||||
if v_1.Op != OpStructMake {
|
||||
if v_1.Op != OpStructMake || len(v_1.Args) != 1 {
|
||||
break
|
||||
}
|
||||
v.copyOf(imakeOfStructMake(v))
|
||||
|
|
|
|||
|
|
@ -1,25 +0,0 @@
|
|||
// compile
|
||||
|
||||
// Copyright 2025 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
|
||||
|
||||
type Type struct {
|
||||
any
|
||||
}
|
||||
|
||||
type typeObject struct {
|
||||
e struct{}
|
||||
b *byte
|
||||
}
|
||||
|
||||
func f(b *byte) Type {
|
||||
return Type{
|
||||
typeObject{
|
||||
b: b,
|
||||
},
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue