Open
Description
In Intel syntax mode without prefixes, writing mov rax, some_symbol
is equivalent to mov rax, [some_symbol]
: in both cases it refers to the memory pointed to by the symbol. However, I've seen multiple people think the former syntax obtains the address of the symbol instead. (Referring to the address of the symbol requires offset
, which doesn't currently work in LLVM.) This confusion can result in bugs that are quite difficult to debug.
I think it'd be appropriate, working in conjunction with a future version of LLVM's assembly parser, to catch "bare" uses of symbols, and suggest either adding []
around it to access the memory pointed to by the symbol, or adding offset
to use the address of the symbol.
Metadata
Metadata
Assignees
Labels
Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Inline assembly (`asm!(…)`)Area: Lints (warnings about flaws in source code) such as unused_mut.Category: An issue proposing an enhancement or a PR with one.`#![feature(asm)]` (not `llvm_asm`)Relevant to the compiler team, which will review and decide on the PR/issue.