This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/19953] Special-case real + complex arithmetic operation (-ffast-math)
- From: "Thomas dot Koenig at online dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Mar 2005 21:26:02 -0000
- Subject: [Bug middle-end/19953] Special-case real + complex arithmetic operation (-ffast-math)
- References: <20050214155119.19953.Thomas.Koenig@online.de>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From Thomas dot Koenig at online dot de 2005-03-01 21:26 -------
(In reply to comment #18)
> > <L2>:;
> > D.2390 = 0.0 / SR.22;
> > D.2392 = SR.22 + D.2390 * 0.0;
> > c$real = (D.2371 + D.2372 * D.2390) / D.2392;
> > c$imag = (D.2372 - D.2371 * D.2390) / D.2392;
> >
> > in *.t65.optimized for the simple test case with -O1 and -O3. As you
> > have stated, this is independent of PR 20139.
>
> Yes that code is correct. as 0.0/SR.22 is not 0.0 if SR.22 is NAN.
> and 0.0 * D.2390 is not 0.0 if D.2390 is NAN.
Ok, then I have misunderstood you - you were referring to the
results with -ffast-math.
However, there still is a missed optimization here.
If SR.22 is NaN, then the proposed simplification
c$real = D.2371 / SR.22;
c$imag = D.2372 / SR.22
would still yield NaN for c$real and c$imag, which is correct.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19953