-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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: invalid instruction error for FMOVD when compiling for 387 #22429
Comments
CC @randall77 Tentatively marking as 1.9.3. |
@TheTincho I'm having trouble reproducing this. There is no |
I can't reproduce this, anyway:
the build command succeeds and the generated test binary runs fine. Not sure what I'm doing wrong. |
I can't reproduce yet, but I think I know what is wrong. Normally this happens for ops with indexed addressing mode, and scale==1. Then the order of the base and index registers don't matter to SSA, so they can appear in either order. We have code to swap them during assembly generation, like this (from amd64/ssa.go):
I'll prepare a CL. It would be nice to be able to reproduce the OP's problem so we can be sure it is fixed. |
Change https://golang.org/cl/73551 mentions this issue: |
@TheTincho I've uploaded a patch. If you can, please try it and let us know if it fixes your issue. |
I concocted a stand-alone repro and added it to the patch. |
Reopening for 1.9.3. |
Thank you all for looking at this so quickly! @randall77: Like @ALTree said, this is from the 1.8 branch, that's why you were missing the package. And about the non-reproducibility, maybe something is slightly different because of our patches in Debian.. In any case, I am now rebuilding the golang-go Debian package with this patch, to see if the problem is solved. |
Confirmed, this solves the issue. Thanks!! |
CL 73551 OK for Go 1.9.3. |
Change https://golang.org/cl/88317 mentions this issue: |
…ex register ...because that's an illegal addressing mode. I double-checked handling of this code, and 387 is the only place where this check is missing. Fixes #22429 Change-Id: I2284fe729ea86251c6af2f04076ddf7a5e66367c Reviewed-on: https://go-review.googlesource.com/73551 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-on: https://go-review.googlesource.com/88317 Run-TryBot: Andrew Bonventre <andybons@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
go1.9.3 has been packaged and includes:
The release is posted at golang.org/dl. — golang.org/x/build/cmd/releasebot, Jan 22 21:02:54 UTC |
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version go1.9.1 linux/386
What operating system and processor architecture are you using (
go env
)?What did you do?
I did not try to isolate a minimal test case, as I have no idea what is going on. But at least one package in Debian is failing to build because of this (prometheus).
When compiling the tests, this line fails with the following error:
I can't reproduce this problem with go 1.7 or 1.8 from Debian. Disabling optimisations with
-gcflags=-N
seems to solve the issue.Looking at #21860, I guess that this could something else than an "invalid instruction", but I have no idea :-)
The text was updated successfully, but these errors were encountered: