HomePhabricator

Return undef on FP <-> Int conversions that overflow (PR21330).

Description

Return undef on FP <-> Int conversions that overflow (PR21330).

The LLVM Lang Ref states for signed/unsigned int to float conversions:
"If the value cannot fit in the floating point value, the results are undefined."

And for FP to signed/unsigned int:
"If the value cannot fit in ty2, the results are undefined."

This matches the C definitions.

The existing behavior pins to infinity or a max int value, but that may just
lead to more confusion as seen in:
http://llvm.org/bugs/show_bug.cgi?id=21130

Returning undef will hopefully lead to a less silent failure.

Differential Revision: http://reviews.llvm.org/D5603

Details

Committed
spatelOct 10 2014, 4:00 PM
Differential Revision
D5603: Return undef on conversions that overflow (PR21330).
Parents
rL219541: Follow-up to r219534 to make symbolization more robust.
Branches
Unknown
Tags
Unknown