Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
cmd/compile: PPC64.rules for Zero are not checking alignment #21947
Go version: 1.9
Seems that PPC64.rules for Zero are not checking alignment in the cases when they should be.
compile: invalid offset for DS form load/store 00056 (/home/rdutra/repos/aports/community/geth/src/go-ethereum-1.7.0/build/_workspace/src/github.com/ethereum/go-ethereum/eth/downloader/statesync.go:452) MOVD R0, "".~r2+33(FP)
Steps to reproduce the behaviour
Clone go-ethereum repository in a ppc64le distribution
When a MOVD instruction is used the offset field must be a multiple of 4. We had seen this problem a few months ago but MOVDstorezero did not get fixed at that time.
It can be reproduced when there is a function with something like this:
When there is a MOVDstorezero to data that is >= 8 bytes but not nicely aligned, you can hit this error.
No, not related to #22047, the failure in this issue would show up as a compile time error, because in the rare case where the field being zeroed is not aligned to 4 bytes as required by the instruction, the assembler would issue an error message and fail the compile.
…e zero When a MOVDstorezero (8 bytes) is used the offset field in the instruction must be a multiple of 4. This situation had been corrected in the rules for other types of stores but not for the zero case. This also removes some of the special MOVDstorezero cases since they can be handled by the general LowerZero case. Updates made to the ssa test for lowering zero moves to include cases where the target is not aligned to at least 4. Fixes #21947 Change-Id: I7cceceb1be4898c77cd3b5e78b58dce0a7e28edd Reviewed-on: https://go-review.googlesource.com/64970 Run-TryBot: Lynn Boger <email@example.com> TryBot-Result: Gobot Gobot <firstname.lastname@example.org> Reviewed-by: Carlos Eduardo Seo <email@example.com> Reviewed-by: Cherry Zhang <firstname.lastname@example.org> Reviewed-on: https://go-review.googlesource.com/70978 Run-TryBot: Russ Cox <email@example.com>