Open fengyoulin opened 4 days ago
Related Issues
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)
The sample code comes from issue 47107, which should have been fixed by CL 578376, and only have the problem when compiling with -gcflags='-d=ssa/check/on'
.
Change https://go.dev/cl/629016 mentions this issue: cmd/compile: do not treat OpLocalAddr as load in DSE
CC @golang/compiler.
Go version
go version devel go1.24-3ca78afb3b Mon Nov 18 04:56:52 2024 +0000 linux/amd64
Output of
go env
in your module/workspace:What did you do?
Compile the following code, the first time with no
-gcflags
, the second with-gcflags='-d=ssa/check/on'
, then compare the assembly code.What did you see happen?
The assembly code generated without
-gcflags
:And the assembly code generated with
-gcflags='-d=ssa/check/on'
:It seems that the redundant zeroing cannot be removed when compiling with
-gcflags='-d=ssa/check/on'
.What did you expect to see?
The redundant zeroing can be removed even when compiling with
-gcflags='-d=ssa/check/on'
.