Skip to content

Commit 78d89b2

Browse files
committed
[release-branch.go1.21] Revert "cmd/compile: don't combine loads in generated equality functions"
This reverts CL 583303. Reason for revert: release branch is currently frozen. Change-Id: Icbdb73b5b40690a875497dd0dc57ca84c728ef6f Reviewed-on: https://go-review.googlesource.com/c/go/+/582961 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]>
1 parent 58e77ad commit 78d89b2

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
@@ -374,11 +374,6 @@ func eqmem(p ir.Node, q ir.Node, field *types.Sym, size int64) ir.Node {
374374
}
375375

376376
func eqmemfunc(size int64, t *types.Type) (fn *ir.Name, needsize bool) {
377-
if !base.Ctxt.Arch.CanMergeLoads && t.Alignment() < int64(base.Ctxt.Arch.Alignment) && t.Alignment() < t.Size() {
378-
// We can't use larger comparisons if the value might not be aligned
379-
// enough for the larger comparison. See issues 46283 and 67160.
380-
size = 0
381-
}
382377
switch size {
383378
default:
384379
fn = typecheck.LookupRuntime("memequal")

test/fixedbugs/issue67160.go

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

0 commit comments

Comments
 (0)