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

Global named registers support for pointer types #20211

Closed
rengolin opened this issue May 23, 2014 · 2 comments
Closed

Global named registers support for pointer types #20211

rengolin opened this issue May 23, 2014 · 2 comments
Assignees
Labels
bugzilla Issues migrated from bugzilla clang:codegen

Comments

@rengolin
Copy link
Member

Bugzilla Link 19837
Resolution FIXED
Resolved on Jun 05, 2014 11:56
Version unspecified
OS Linux
CC @jsonn,@rnk

Extended Description

Pointer types are supposed to fit on the architecture registers, so it should be reasonably safe to assume they're safe for named registers. The code below asserts on Clang (Bad register type):

struct p4_Thread {
struct {
int len
} word
};
register struct p4_Thread *p4TH asm("%r15");
fn1() {
(*p4TH).word.len;
}

Not only we could add support for pointer types, but we must not assert on bad register types. We should have an error on SemaDecl before it gets to CGExpr, by checking the type of the register variable and emitting a proper error.

Once this is accepted by Clang, it will fail on LLVM, since "%r15" is not in the list of registers accepted. But that's a separate problem.

@rengolin
Copy link
Member Author

assigned to @rengolin

@rengolin
Copy link
Member Author

rengolin commented Jun 5, 2014

Fixed on r210274

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 9, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla clang:codegen
Projects
None yet
Development

No branches or pull requests

1 participant