llvm-9+ machine code instruction selection has introduced a new assembly instruction negating bool values. I have not been able to track when this was introduced in LLVM, but @mo-xiaoming has recently demonstrated that this is definitely a broken behavior introduced by LLVM starting from version 9. He has filed a bug report to llvm-project, here.
Until LLVM devs address the defect, let's patch our compilation in C++ by hand.
Evidence of UB and how the fix works can be found at godbolt
See this comment
llvm-9+ machine code instruction selection has introduced a new assembly instruction negating bool values. I have not been able to track when this was introduced in LLVM, but @mo-xiaoming has recently demonstrated that this is definitely a broken behavior introduced by LLVM starting from version 9. He has filed a bug report to llvm-project, here.
Until LLVM devs address the defect, let's patch our compilation in C++ by hand.
Evidence of UB and how the fix works can be found at godbolt