Skip to content
Commit 7363a9a9 authored by Szabolcs Nagy's avatar Szabolcs Nagy
Browse files

math: Fix asin and acos invalid exception with old gcc

This works around a gcc issue where it const folded inf/inf into nan,
preventing the invalid exception to be signalled.

(x-x)/(x-x) is more robust against optimizations and works for all
out of bounds values including x==nan.

The gcc issue https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95115


should be fixed on release branches starting from gcc-10, but it is
better to change the code in case glibc is built with older gcc.

Reviewed-by: default avatarWilco Dijkstra <Wilco.Dijkstra@arm.com>
parent be066536
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment