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/internal/obj/x86: imprecise "offset overflow" error message on AMD64 #24871

Closed
quasilyte opened this issue Apr 15, 2018 · 2 comments
Closed
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@quasilyte
Copy link
Contributor

quasilyte commented Apr 15, 2018

CL59630 introduced additional offset overflow checks for AMD64.

This issue reports regression in error message quality.

What did you do?

Assemble this file with go tool asm on AMD64 platform:

TEXT badOffset(SB), 0, $0
        MOVL 999999999999(AX), AX
        RET

What did you expect to see?

Error about offset (displacement) overflow.
Something like "offset too large".

What did you see instead?

Generic "invalid instruction" error.

go tool asm foo.s
asm: invalid instruction: 00000 (foo.s:2)	MOVL	999999999999(AX), AX
asm: assembly failed

Note: it works on GOARCH=386 as expected:

GOARCH=386 go tool asm foo.s
asm: offset too large in 00018 (foo.s:2)	MOVL	999999999999(AX), AX
asm: assembly failed

Related to #21860.

@gopherbot
Copy link

Change https://golang.org/cl/107116 mentions this issue: cmd/internal/obj/x86: better error msg for offset overflow on AMD64

@quasilyte quasilyte changed the title cmd/internal/obj/x86: imprecise error offset overflow message on AMD64 cmd/internal/obj/x86: imprecise "offset overflow" error message on AMD64 Apr 15, 2018
@andybons
Copy link
Member

@randall77

@andybons andybons added the NeedsFix The path to resolution is known, but the work has not been done. label Apr 16, 2018
@andybons andybons added this to the Unplanned milestone Apr 16, 2018
@golang golang locked and limited conversation to collaborators Apr 17, 2019
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

3 participants