This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH]: Fix PR middle-end/30789, complex math folding via MPC
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: "Kaveh R. GHAZI" <ghazi at caip dot rutgers dot edu>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 14 Aug 2009 10:52:07 +0000 (UTC)
- Subject: Re: [PATCH]: Fix PR middle-end/30789, complex math folding via MPC
- References: <Pine.GSO.email@example.com>
On Fri, 14 Aug 2009, Kaveh R. GHAZI wrote:
> The Annex G special cases only occur in cases where NaN is returned. Since
> GCC's MPC infrastructure already backs out when encountering NaN values,
> using MPC here means folding doesn't occur and the correct Annex G values
> are calculated by libgcc at runtime.
These cases still need to work in static initializers, so you may need to
avoid the MPC infrastructure backing out when evaluating static
initializers, and add tests of them to your testcase.
> + /* This becomes (NaN + iInf). */
> +#define VAL1 ((_Complex double)__builtin_inf() * 1i)
> + /* Test some C99 Annex G special cases. */
> + TEST_ONE_PART_INF ((VAL1) * (VAL1));
> + TEST_ONE_PART_INF ((_Complex double)1 / (_Complex double)0);
> + TEST_ONE_PART_INF ((VAL1) / (_Complex double)1);
I don't see a test of the ((_Complex double) 1 / (VAL1)) example I gave
(that should produce a zero).
Joseph S. Myers