Issue 91648
Summary [BOLT] Support PIC fixed branch
Labels BOLT
Assignees
Reporter aaupov
    [bolt-x86_64-ubuntu-clang](https://lab.llvm.org/buildbot/#/builders/252) started to fail with jump table heuristic failure (https://lab.llvm.org/buildbot/#/builders/252/builds/9615).

The crash is caused by the following function in GCC-built Clang:
_ZN5clang15ModuleMapParser23parseOptionalAttributesERNS_9ModuleMap10AttributesE.localalias

Unsupported code pattern is the following:
```
81a3a0f: 48 63 05 16 b4 03 fa movslq  -0x5fc4bea(%rip), %rax  # 0x21dee2c <CSWTCH.677+0x3dc>
81a3a16: 48 8d 15 03 b4 03 fa          leaq  -0x5fc4bfd(%rip), %rdx  # 0x21dee20 <CSWTCH.677+0x3d0>
81a3a1d: 48 01 d0                      addq  %rdx, %rax
81a3a20: 3e ff e0                      jmpq  *%rax
```

The compiler could have avoided using PIC jump table access pattern and instead jump to the target directly. But since it has not, we need to gracefully handle that.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to