[PATCH] D76114: [MC] Recalculate fragment offsets after relaxation

Kan Shengchen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 16 20:12:39 PDT 2020


skan added a comment.

In D76114#1925746 <https://reviews.llvm.org/D76114#1925746>, @skan wrote:

> In D76114#1925719 <https://reviews.llvm.org/D76114#1925719>, @MaskRay wrote:
>
> > Do we know which commit caused the regression? Is it related to one of the recent x86 instruction padding patches?
>
>
> It's not a regression. The current relaxation implementation has never considered (or intended to support) this corner case.


The main reason for the newly added test case fail is that `MCFragment` caches its offset (for faster layout), but does not cache its size. So when the size of a fragment changes, the offset of the fragment behind it will change. So if the subsequent fragment does not update its cached offset (because it is considered as valid), some checks will fail.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D76114





More information about the llvm-commits mailing list