Displaying 2 results from an estimated 2 matches for "compilerrt_abort".
2015 Oct 24
2
[compiler-rt] Undefined negation in float emulation functions
...return x != expected;
}
The printf suggests to me that the test should fail if `expected` is negative (which seems perfectly reasonable), but
the return statement does not include this condition. I tried to explore this a little, but it turns out calling
__absvisi2 with INT_MIN triggers compilerrt_abort(). Seems perfectly reasonable as abs(INT_MIN) is documented to be
undefined, however the call to compilerrt_abort sits behind this check:
const int N = (int)(sizeof(si_int) * CHAR_BIT);
if (a == (1 << (N-1)))
compilerrt_abort();
The shift in this expression is done on a...
2015 Oct 20
2
[compiler-rt] Undefined negation in float emulation functions
Hi,
I recently came across the following in __floatsidf in compiler-rt:
__floatsidf(int a) {
...
if (a < 0) {
...
a = -a;
In the case where a == INT_MIN, is this negation not undefined behaviour? AIUI this function is used for software
emulation on targets that have no hardware floating point support. Perhaps there is an in-built assumption