[PATCH] D73176: [ARM] Fix dropped dollar sign from symbols in branch targets
Lucas Prates via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 24 03:58:19 PST 2020
pratlucas added a comment.
In D73176#1835170 <https://reviews.llvm.org/D73176#1835170>, @efriedma wrote:
> If the goal here is to match the GNU assembler, I don't think you've achieved that; gas treats "b $4" as a branch to the symbol "$4", not an absolute offset.
Good point @efriedma , I took a look at gas and it indeed handles $4 as a symbol on branch instructions.
I've checked the patch that originated the existing behavior (ef70e9b704f7f482faac0696c7288743061ed652 <https://github.com/llvm/llvm-project/commit/ef70e9b704f7f482faac0696c7288743061ed652>) and it appears to have introduced this intentionally, though. The following part of the commit message got me concerned that we might break the handling of legacy code if matching gas' behavior:
> Backwards compatibility with 'gas'. #imm is the preferered and documented syntax, but lots of existing code uses the '$' prefix, so we should support it if we can.
Do you have any thoughts on that? I couldn't find any example of the mentioned "existing code" on the regression tests.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D73176/new/
https://reviews.llvm.org/D73176
More information about the llvm-commits
mailing list