Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/compile/internal/test: TestAppendOfMake fails with GOEXPERIMENT=unified #54337

Closed
dmitshur opened this issue Aug 8, 2022 · 3 comments
Closed
Assignees
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@dmitshur
Copy link
Contributor

dmitshur commented Aug 8, 2022

Observed in trybots of CL 420234:

--- FAIL: TestAppendOfMake (0.00s)
    issue53888_test.go:29: got 1.000000 allocs, want 0
    issue53888_test.go:41: got 1.000000 allocs, want 0
FAIL
FAIL	cmd/compile/internal/test	9.922s

(https://storage.googleapis.com/go-build-log/7622dec8/linux-amd64-unified_f57873d7.log)

It seems to happen reproducibly by looking at build.golang.org, though it's less noticeable because the builder is marked as having a known issue #52150. Still, the builder is currently in the default TryBot set, so this needs attention.

CC @randall77.

@dmitshur dmitshur added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Soon This needs action soon. (recent regressions, service outages, unusual time-sensitive situations) labels Aug 8, 2022
@dmitshur dmitshur added this to the Go1.20 milestone Aug 8, 2022
@cuonglm
Copy link
Member

cuonglm commented Aug 8, 2022

I think because CL 420234 is sent before dev.unified was merge to master, so the try-bot doesn't observe the failure earlier.

Unified IR currently re-write the IR as:

before walk genericExtend[[]uint8,uint8]-shaped
.   AS tc(1) # r.go:11:22
.   .   NAME-p..autotmp_4 esc(N) Class:PAUTO Offset:0 AutoTemp OnStack Used int tc(1) # r.go:11:22
.   .   CAP int tc(1) # r.go:11:22
.   .   .   NAME-p.s esc(no) Class:PPARAM Offset:0 OnStack Used SLICE-[]byte tc(1) # r.go:10:35
.   AS tc(1) # r.go:11:17
.   .   NAME-p..autotmp_5 esc(N) Class:PAUTO Offset:0 AutoTemp OnStack Used SLICE-[]byte tc(1) # r.go:11:17
.   .   SLICE SLICE-[]byte tc(1) # r.go:11:17
.   .   .   NAME-p.s esc(no) Class:PPARAM Offset:0 OnStack Used SLICE-[]byte tc(1) # r.go:10:35
.   .   SLICE-High
.   .   .   NAME-p..autotmp_4 esc(N) Class:PAUTO Offset:0 AutoTemp OnStack Used int tc(1) # r.go:11:22
.   AS tc(1) # r.go:11:32
.   .   NAME-p..autotmp_6 esc(N) Class:PAUTO Offset:0 AutoTemp OnStack Used SLICE-[]byte tc(1) # r.go:11:32
.   .   MAKESLICE esc(h) SLICE-[]byte tc(1) # r.go:11:32
.   .   MAKESLICE-RType
.   .   .   CONVNOP PTR-*uint8 tc(1) # r.go:11:32
.   .   .   .   INDEX uintptr tc(1) # r.go:11:32
.   .   .   .   .   DEREF Implicit ARRAY-[6]uintptr tc(1) # r.go:11:32
.   .   .   .   .   .   NAME-p..dict esc(no) Class:PPARAM Offset:0 OnStack Used PTR-*[6]uintptr tc(1) # r.go:10:6
.   .   .   .   .   LITERAL-1 int tc(1) # r.go:11:32
.   .   MAKESLICE-Len
.   .   .   NAME-p.n esc(no) Class:PPARAM Offset:0 OnStack Used int tc(1) # r.go:10:40
.   AS tc(1) # r.go:11:15
.   .   NAME-p..autotmp_7 esc(N) Class:PAUTO Offset:0 AutoTemp OnStack Used SLICE-[]byte tc(1) # r.go:11:15
.   .   APPEND IsDDD SLICE-[]byte tc(1) # r.go:11:15
.   .   APPEND-Args
.   .   .   NAME-p..autotmp_5 esc(N) Class:PAUTO Offset:0 AutoTemp OnStack Used SLICE-[]byte tc(1) # r.go:11:17
.   .   .   CONVNOP Implicit SLICE-[]byte tc(1) # r.go:11:15
.   .   .   .   NAME-p..autotmp_6 esc(N) Class:PAUTO Offset:0 AutoTemp OnStack Used SLICE-[]byte tc(1) # r.go:11:32
.   .   APPEND-RType
.   .   .   CONVNOP PTR-*uint8 tc(1) # r.go:11:15
.   .   .   .   INDEX uintptr tc(1) # r.go:11:15
.   .   .   .   .   DEREF Implicit ARRAY-[6]uintptr tc(1) # r.go:11:15
.   .   .   .   .   .   NAME-p..dict esc(no) Class:PPARAM Offset:0 OnStack Used PTR-*[6]uintptr tc(1) # r.go:10:6
.   .   .   .   .   LITERAL-1 int tc(1) # r.go:11:15

So the append of make form isn't detected so the optimization is skipped.

Also cc @mdempsky

@dmitshur
Copy link
Contributor Author

dmitshur commented Aug 8, 2022

Removing Soon label since CL 422037 added a " && !goexperiment.unified" build constraint, so the builder doesn't fail now. Thanks.

@dmitshur dmitshur removed the Soon This needs action soon. (recent regressions, service outages, unusual time-sensitive situations) label Aug 8, 2022
@dmitshur dmitshur changed the title cmd/compile/internal/test: TestAppendOfMake fails on linux-amd64-unified cmd/compile/internal/test: TestAppendOfMake fails with GOEXPERIMENT=unified Aug 8, 2022
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/422040 mentions this issue: cmd/compile: do not write implicit conversion for append in Unified IR

@cuonglm cuonglm added NeedsFix The path to resolution is known, but the work has not been done. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Aug 8, 2022
jproberts pushed a commit to jproberts/go that referenced this issue Aug 10, 2022
Same as CL 418475, but for Unified IR.

Updates golang#53888
Fixes golang#54337

Change-Id: I31d5a7af04d8e3902ed25db85009d46ea4c38dbe
Reviewed-on: https://go-review.googlesource.com/c/go/+/422040
TryBot-Result: Gopher Robot <[email protected]>
Reviewed-by: Matthew Dempsky <[email protected]>
Run-TryBot: Cuong Manh Le <[email protected]>
Reviewed-by: Than McIntosh <[email protected]>
@golang golang locked and limited conversation to collaborators Aug 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

4 participants