<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/81358>81358</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Failure with `-O2 -m32 -mno-sse -mfpmath=387 -fexcess-precision=standard`
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
dilyanpalauzov
</td>
</tr>
</table>
<pre>
Per https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113679#c11 seems clang is buggy:
> $ clang -O2 -m32 -mno-sse -mfpmath=387 -fexcess-precision=standard
```c
#include <float.h>
int main () {
#if FLT_EVAL_METHOD == 2 && LDBL_MANT_DIG == 64 && DBL_MANT_DIG == 53
if ((double) 191.18831051580915 == 191.18831051580915)
__builtin_abort ();
#endif
}
```
should always succeed, because if FLT_EVAL_METHOD is 2, it ought to be evaluated as (long double) (double) 191.18831051580915L == 191.18831051580915L and (double) 191.18831051580915L is 0x1.7e606a3c65c95p+7 while 191.18831051580915L is 0x1.7e606a3c65c9503ap+7L, so they aren't equal.
With gcc 13.2.1 the program terminates, with clang 17.0.5 it aborts with core dump.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykVE2P2zYQ_TWjy8ACP_R50GE3WrUFnKaHRXs0KGoksaBEVyR34_z6QrYXG6QpUqCAQWPw5r2ZNyJHeW-mlaiB_BHyNlExzG5rBmMvaj0rq-IX95L0brg0v9GGcwhnD_IBRAeim7ROpzWmbptAdH2cvhhrFYjOz-711Mcp1ZMB2ZkBZMu5LMoahNScoydaPGqr1gmNxz5O02WXZS2wt1M-IYjsnnT4JPCwyP1Y3cF7wsMynhcVZpCtrEo8jPRZk_eH80baeONWkK0Pah3UNtwVC3b76XsspFm1jQMhyA-jdSqkM8inr7swa8BFmRVBVCBqhPLxnTxid3w-Pf3-cDx9fHr--VOLIFuQLQoEUYAo8Ng-Hk8fH359PrW__PSGFtkb_D00l7cCiGa8Va0GF3tLe3le85RXleQs53nFap6_0f6JgKjvSqdTH40NZj2p3m3h7gXkuxVaBzPeo7L9Zly30M8u2gGVfVUXjz5qTTSA-IA9aRU94XfGYTyKPcUEdHGaAwaHPSG9KBtVoAGV35uxbp3w3eQPHB__3fIR1Tr8mG88ss88LalghZK6yHWdn0E8lvg6G0v_mcOkutKOu0fvMMx0QbXRCqIMSH9FZdOvL9MfJsw4aY1cpiLlez6eNzdtasFA22JWFcjvYq975u3m8zJlab6P8Prx_B1zG-EQl3OaDI0calmrhBpesjIv86yskrnhWVExWctRUZGXucxHVo5lybO6r-uClYlpBBMZE5zxTHJepbXIddYTUT2OY64qyBgtytjU2pdlf-WJ8T5SU3GZV4lVPVl_XRxCrPSKVxCE2PfI1uycQx8nDxmzxgf_rhJMsNR0yti40c0PFOx_PvGCJXGzzTcbyoQ59ql2C4hur3__O5w39yfpAKK7du1BdFdXfwcAAP__BRV2Ag">