[PATCH] D157694: [RISCV][MC]Add support for Binary MCExpr

Yunze Zhu(Thead) via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 14 23:15:30 PDT 2023


Yunzezhu added a comment.

In D157694#4584915 <https://reviews.llvm.org/D157694#4584915>, @asb wrote:

> Thanks for catching this. It looks like if you do e.g. `.LBB0-16` it will just underflow - do other targets do anything smarter here?

It seems PowerPC handles expr with binary expression opcode add only by adding an assert, so no underflow happens without sub kind binary expr. Other targets support binary expr like Hexagon and Lanai get fixup kind separately from LHS and RHS or from LHS only, and ignore such possible underflow.
I tried gcc and gcc supports sub kind binary exprs like .LBB0-16 too. I'm not sure if such sub expr will cause underflow since local symbol handles relocation only and global symbol looks have little chance of underflow.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D157694/new/

https://reviews.llvm.org/D157694



More information about the llvm-commits mailing list