Skip to content

cmd/internal/obj/arm: two bugs in asm5.go #20516

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

Closed
benshi001 opened this issue May 28, 2017 · 2 comments
Closed

cmd/internal/obj/arm: two bugs in asm5.go #20516

benshi001 opened this issue May 28, 2017 · 2 comments

Comments

@benshi001
Copy link
Member

benshi001 commented May 28, 2017

There is a typo

line 1066
if immrot(v) == 0 {
return v, 0
}

it should be
if immrot(v) != 0 {
return v, 0
}

The original intention is
if "v is already imm-12" {
return v, 0
} else {
return y, x // y - x = v
}

But actually become
if "v is not imm-12" {
return v, 0
}

So case 107 of the optab never be triggered.

@gopherbot
Copy link
Contributor

CL https://golang.org/cl/44335 mentions this issue.

@benshi001
Copy link
Member Author

One more issue, "ADD $0xffff, R0" still uses the constant pool, it should be the same as "ADD $0xffff,R0,R0".

@benshi001 benshi001 changed the title cmd/internal/obj/arm: typo in asm5.go cmd/internal/obj/arm: two bugs in asm5.go May 31, 2017
@golang golang locked and limited conversation to collaborators Jun 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants