This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/81478] By default, GCC emits a function call for complex multiplication, should partially inline that
- From: "smcallis at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 19 Jul 2017 19:25:54 +0000
- Subject: [Bug middle-end/81478] By default, GCC emits a function call for complex multiplication, should partially inline that
- Auto-submitted: auto-generated
- References: <bug-81478-4@http.gcc.gnu.org/bugzilla/>
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.