[PATCH] D121571: [TableGen] X86 mnemonic tables backend
Markus Böck via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 21 07:10:35 PDT 2022
zero9178 added a comment.
Hello!
An LLVM build of mine that has UBsan enabled has started failing since this commit. The error itself is:
[5/1719] Building X86GenMnemonicTables.inc...
FAILED: lib/Target/X86/X86GenMnemonicTables.inc
cd /mnt/c/LLVM/llvm-project/llvm/build-wsld && /mnt/c/LLVM/llvm-project/llvm/build-wsld/bin/llvm-tblgen -gen-x86-mnemonic-tables -asmwriternum=1 -I /mnt/c/LLVM/llvm-project/llvm/lib/Target/X86 -I/mnt/c/LLVM/llvm-project/llvm/build-wsld/include -I/mnt/c/LLVM/llvm-project/llvm/include -I /mnt/c/LLVM/llvm-project/llvm/lib/Target /mnt/c/LLVM/llvm-project/llvm/lib/Target/X86/X86.td --write-if-changed -o lib/Target/X86/X86GenMnemonicTables.inc -d lib/Target/X86/X86GenMnemonicTables.inc.d
../utils/TableGen/X86MnemonicTables.cpp:52:29: runtime error: load of value 96, which is not a valid value for type 'bool'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../utils/TableGen/X86MnemonicTables.cpp:52:29 in
It seems like at `X86MnemonicTables.cpp:52` you are accessing the `IsCodeGenOnly` field of `RI`, yet the constructor in `X86RecognizableInstr.cpp:95` only initializes that field conditionally (based on the early return at line 75).
Would you mind taking a look? I'd suggest initializing those bool fields to some sane defaults or at the very least make the access in `X86MnemonicTables.cpp:52` conditional.
For the sake of completion: These were the build options I used:
cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/mnt/c/Libraries/WSL/LLVMd -DLLVM_ENABLE_PROJECTS="mlir;lld" -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_USE_SANITIZER="Address;Undefined" -DLLVM_BUILD_TOOLS=OFF -DLLVM_BUILD_UTILS=ON -DLLVM_BUILD_TESTS=OFF -DCMAKE_C_COMPILER=clang-12 -DCMAKE_CXX_COMPILER=clang++-12 -DLLVM_ENABLE_LIBXML2=OFF -DLLVM_INSTALL_UTILS=ON -DLLVM_FORCE_ENABLE_STATS=ON -DLLVM_ENABLE_LLD=ON
Thanks
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D121571/new/
https://reviews.llvm.org/D121571
More information about the llvm-commits
mailing list