[llvm-bugs] [Bug 37305] New: Clang warning message on FP to integer implicit conversion is inconsistent with its behavior.

via llvm-bugs llvm-bugs at lists.llvm.org
Tue May 1 08:03:14 PDT 2018


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

            Bug ID: 37305
           Summary: Clang warning message on FP to integer implicit
                    conversion is inconsistent with its behavior.
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: erich.keane at intel.com
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org

Given the following reproducer:

short s() {
return 32768.0;
}
char c() {
return 128.0;
}

We get the warnings:
warning: implicit conversion from 'double' to 'short' changes value from 32768
to 32767 
and
warning: implicit conversion from 'double' to 'char' changes value from 128 to
127 

HOWEVER, the LLVM-IR emitted actually replaces the 'ret' with ret i16 undef and
ret i8 undef respectively.

We should make this consistent, either by altering the commit message or by
changing the behavior.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180501/87f0ba41/attachment-0001.html>


More information about the llvm-bugs mailing list