This is an archive of the discontinued LLVM Phabricator instance.

[llvm] Initialize and move UseUpRegs outside of `union` MemOp struct.
ClosedPublic

Authored by pifon2a on Mar 24 2022, 8:31 AM.

Details

Summary

Asan complained about uninitialized bool

invalid-bool-load
llvm/lib/Target/X86/AsmParser/X86Operand.h:389:12: runtime error: load
of value 171, which is not a valid value for type 'bool'

Diff Detail

Event Timeline

pifon2a created this revision.Mar 24 2022, 8:31 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 24 2022, 8:31 AM
pifon2a requested review of this revision.Mar 24 2022, 8:31 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 24 2022, 8:31 AM
bkramer accepted this revision.Mar 24 2022, 8:36 AM
bkramer added reviewers: xiangzhangllvm, skan.

I think this is fine.

This revision is now accepted and ready to land.Mar 24 2022, 8:37 AM
This revision was landed with ongoing or failed builds.Mar 24 2022, 8:53 AM
This revision was automatically updated to reflect the committed changes.

First thanks very much for this patch!

I didn't understand why Buildbot fail on clang/test/CodeGen/ms-inline-asm.c on sanitizer-x86_64-linux-bootstrap-ubsan

This test passed in my local machine (before/without this patch).
$../build-all/bin/llvm-lit clang/test/CodeGen/ms-inline-asm.c
-- Testing: 1 tests, 1 workers --
PASS: Clang :: CodeGen/ms-inline-asm.c (1 of 1)

Testing Time: 0.51s
  Passed: 1
skan added a comment.Mar 24 2022, 6:34 PM

LGTM, thanks!

First thanks very much for this patch!

I didn't understand why Buildbot fail on clang/test/CodeGen/ms-inline-asm.c on sanitizer-x86_64-linux-bootstrap-ubsan

This test passed in my local machine (before/without this patch).
$../build-all/bin/llvm-lit clang/test/CodeGen/ms-inline-asm.c
-- Testing: 1 tests, 1 workers --
PASS: Clang :: CodeGen/ms-inline-asm.c (1 of 1)

Testing Time: 0.51s
  Passed: 1

Not sure if you need to run asan check mannually. Here are config for sanitizer-x86_64-linux-bootstrap-ubsan: https://github.com/llvm/llvm-zorg/blob/main/zorg/buildbot/builders/sanitizers/buildbot_cmake.sh

Not sure if you need to run asan check mannually. Here are config for sanitizer-x86_64-linux-bootstrap-ubsan: https://github.com/llvm/llvm-zorg/blob/main/zorg/buildbot/builders/sanitizers/buildbot_cmake.sh

Thanks for reminding! I think this must be compiler-rt use X86Operand code problem. Any way, these has be fixed by pifon2a. There is no logic changes, Let it be : )

Asan complained about uninitialized bool

It's not "uninitialized" :) It's a value outside of {0, 1}.