https://bugs.llvm.org/show_bug.cgi?id=36719
Bug ID: 36719
Summary: [GlobalISel] i1 boolean is signed extended to -1
Product: new-bugs
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: new bugs
Assignee: unassignedb...@nondot.org
Reporter: mgr...@codeaurora.org
CC: llvm-bugs@lists.llvm.org
echo "bool a() { return true; }" > a.cpp
clang -x c++ -target aarch64-linux-gnu a.cpp -S -o -
a:
mov w8, #-1 <-- 1 bit boolean true becomes -1.
mov w0, w8
ret
This bug is uncovered when GlobalISel is enabled by default at -O0:
https://reviews.llvm.org/D41362
I attempted to *fix* this here: https://reviews.llvm.org/D44410. But from the
comments I guess the problem is elsewhere.
Basically, an i1 is sign extended to a -1 in GlobalISel legalization. Instead,
a 1 bit boolean should be zero extended.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs