[PATCH] D114194: [SystemZ] Add range checks for PC-relative fixups
Ulrich Weigand via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 7 00:56:02 PST 2021
uweigand added a comment.
One final comment inline, otherwise this LGTM. Thanks!
================
Comment at: llvm/lib/Target/SystemZ/MCTargetDesc/SystemZMCAsmBackend.cpp:43
+ auto handlePCRelFixupValue = [&](unsigned W) -> uint64_t {
+ assert(Value % 2 == 0 && "Non-even PC relative offset.");
+ if (!checkFixupInRange(minIntN(W) * 2, maxIntN(W) * 2))
----------------
Hmm, this scenario could be triggered by wrong assembler input (e.g. something simple like `j .+1`), so I don't think this should result in an assert (internal compiler error).
GCC/binutils currently seems to simply ignore that case (and round down), which also isn't ideal.
I think this really should be a user-level error message, not an assert.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D114194/new/
https://reviews.llvm.org/D114194
More information about the llvm-commits
mailing list