https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123869
--- Comment #12 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Andrew Pinski <[email protected]>: https://gcc.gnu.org/g:41f293e72c253301f71fefc5a5e1040cb468e4ed commit r16-7160-g41f293e72c253301f71fefc5a5e1040cb468e4ed Author: Andrew Pinski <[email protected]> Date: Wed Jan 28 16:50:52 2026 -0800 optabs: Fix expansion of abs and neg for Float16 [PR123869] The problem here is we try to use the widening type before doing the bitwise expansion of neg/and for floating point types. This moves the code around to try the bitwise expansion first. Note this mostly matters for NaNs where you widening (promotion) would cause a NaN to be slightly different when doing the rounding back. Bootstrapped and tested on x86_64-linux-gnu. PR middle-end/123869 gcc/ChangeLog: * optabs.cc (expand_unop): Move the NEG optab handling before the widening code. Move the ABS bitwise expansion from expand_abs_nojump to before the widening code. (expand_abs_nojump): Remove the bitwise expansion trial since expand_unop is called right above. Signed-off-by: Andrew Pinski <[email protected]>
