https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81478
--- Comment #5 from Sean McAllister <smcallis at gmail dot com> --- (In reply to Richard Biener from comment #3) > Confirmed. It shouldn't be very difficult to do, > gcc/tree-complex.c:expand_complex_multiplication would need to emit if > (isnan(rr) || isnan(ri)) <expand_complex_libcall>. > > Unless we want to optimize the corner case futher by skipping the > multiplication > in the libcall in which case we need a new entry in libgcc. > > Note that the same optimization applies to division. I think as rarely as the average user is going to have to deal with NaN/Inf in their complex numbers, doing the multiplication, checking, and then re-doing it if needed with full semantics is totally defensible. Then no need for glibc changes. If all your numbers are NaN/Inf, then performance will be terrible, but you probably have other problems at that juncture anyways.