morganstanley / hobbes

A language and an embedded JIT compiler

Home Page:http://hobbes.readthedocs.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bool evaluation UB introduced with llvm-9+

smunix opened this issue · comments

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