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
gccgo crash on shift of expression involving unsafe.Sizeof #21372
Labels
Milestone
Comments
@ianlancetaylor |
Change https://golang.org/cl/54370 mentions this issue: |
@ianlancetaylor |
hubot
pushed a commit
to gcc-mirror/gcc
that referenced
this issue
Aug 9, 2017
It's possible to construct an lshift expression using unsafe.Sizeof that is technically a compile-time constant but can't be evaluated without going through backend methods. In this case, insure that Type::make_non_abstract_type is called on the numeric operand of the shift (as opposed to leaving as abstract), to avoid an assert later on in the compiler flow. Fixes golang/go#21372. Reviewed-on: https://go-review.googlesource.com/54370 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@251006 138bc75d-0d04-0410-961f-82ee72b054a4
asiekierka
pushed a commit
to WonderfulToolchain/gcc-ia16
that referenced
this issue
May 16, 2022
It's possible to construct an lshift expression using unsafe.Sizeof that is technically a compile-time constant but can't be evaluated without going through backend methods. In this case, insure that Type::make_non_abstract_type is called on the numeric operand of the shift (as opposed to leaving as abstract), to avoid an assert later on in the compiler flow. Fixes golang/go#21372. Reviewed-on: https://go-review.googlesource.com/54370 From-SVN: r251006
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?gccgo tip:
go version go1.8.3 gccgo (GCC) 8.0.0 20170727 (experimental) linux/amd64
What operating system and processor architecture are you using (
go env
)?GOARCH="amd64"
GOHOSTARCH="amd64"
GOOS="linux"
What did you do?
Compiled this fragment:
with "go build -compiler gccgo"
What did you expect to see?
successful build
What did you see instead?
crash with this stack trace
From poking around in the debugger it appears that the type of the left operand of the shift is still an abstract in type, for what that's worth.
The text was updated successfully, but these errors were encountered: