https://bugs.llvm.org/show_bug.cgi?id=48665

            Bug ID: 48665
           Summary: [ConstantFold] llvm generate invalid assemble for type
                    conversion between __fp16 and char
           Product: libraries
           Version: 10.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: X86
          Assignee: unassignedb...@nondot.org
          Reporter: zhongyu...@tom.com
                CC: craig.top...@gmail.com, llvm-bugs@lists.llvm.org,
                    llvm-...@redking.me.uk, pengfei.w...@intel.com,
                    spatel+l...@rotateright.com

Created attachment 24352
  --> https://bugs.llvm.org/attachment.cgi?id=24352&action=edit
clang test_x86.cpp -S -O2 -o test.s

base on the case test_x86.cpp attached and llvm10, compile on the x86 machine
with commands similar as: clang test_x86.cpp -S -O2 -o test.s

#define half __fp16

void host_expect(char * arrDst)
{
    half arrSrc[8] = {(half)0xecee, (half)0xf330, (half)0x698a, (half)0x2583,
(half)0xb45d, (half)0xfc66, (half)0x3587, (half)0x2607};

    for(int i = 0; i < 8; i++)
    {
        arrDst[i] = arrSrc[i];
    }
}


we'll get an empty define of the function host_expect, which is unexpected.

        .globl  _Z11host_expectPc       # -- Begin function _Z11host_expectPc
        .p2align        4, 0x90
        .type   _Z11host_expectPc,@function
_Z11host_expectPc:                      # @_Z11host_expectPc
        .cfi_startproc
# %bb.0:                                # %entry
        retq
.Lfunc_end0:
        .size   _Z11host_expectPc, .Lfunc_end0-_Z11host_expectPc
        .cfi_endproc
                                        # -- End function
        .ident  "clang version 10.0.0

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to