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

echo "bool a() { return true; }" > a.cpp
clang -x c++ -target aarch64-linux-gnu a.cpp -S -o -

mov     w8, #-1     <-- 1 bit boolean true becomes -1.
mov     w0, w8

This bug is uncovered when GlobalISel is enabled by default at -O0:

I attempted to *fix* this here: 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

Reply via email to