Issue 107607
Summary [RISCV] Miscompilation on rv64
Labels new issue
Assignees
Reporter mikhailramalho
    The following program miscompiles when using clang++ for rv64:
```
$ cat foo.cpp 
#include <cmath>

int main() {
  long double y = NAN;
  _Float16 a = static_cast<_Float16>(y);
  return (a != a);
}
```
The cast of `NAN` from `long double` to `_Float16` generates `0`, instead of `NAN`.

It only happens with clang++ in rv64. It works just fine in intel 64 and rv32. Compiling with g++ for rv64 also works.

_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to