10BC0 [release-branch.go1.22] Revert "cmd/compile: don't combine loads in g… · golang/go@947e43e · GitHub
[go: up one dir, main page]

Skip to content

Commit 947e43e

Browse files
committed
[release-branch.go1.22] Revert "cmd/compile: don't combine loads in generated equality functions"
This reverts CL 583417. Reason for revert: release branch is currently frozen. Change-Id: Ia6223911e0e124f14509c4bf978d7e37688e3d4c Reviewed-on: https://go-review.googlesource.com/c/go/+/582960 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
1 parent 9d2e285 commit 947e43e

File tree

2 files changed

+1
-38
lines changed

2 files changed

+1
-38
lines changed

src/cmd/compile/internal/compare/compare.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ func calculateCostForType(t *types.Type) int64 {
148148
return EqStructCost(t)
149149
case types.TSLICE:
150150
// Slices are not comparable.
151-
base.Fatalf("calculateCostForType: unexpected slice type")
151+
base.Fatalf("eqStructFieldCost: unexpected slice type")
152152
case types.TARRAY:
153153
elemCost := calculateCostForType(t.Elem())
154154
cost = t.NumElem() * elemCost
@@ -371,11 +371,6 @@ func eqmem(p, q ir.Node, field int, size int64) ir.Node {
371371
}
372372

373373
func eqmemfunc(size int64, t *types.Type) (fn *ir.Name, needsize bool) {
374-
if !base.Ctxt.Arch.CanMergeLoads && t.Alignment() < int64(base.Ctxt.Arch.Alignment) && t.Alignment() < t.Size() {
375-
// We can't use larger comparisons if the value might not be aligned
376-
// enough for the larger comparison. See issues 46283 and 67160.
377-
size = 0
378-
}
379374
switch size {
380375
case 1, 2, 4, 8, 16:
381376
buf := fmt.Sprintf("memequal%d", int(size)*8)

test/fixedbugs/issue67160.go

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)
0