https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107294

--- Comment #7 from mjr19 at cam dot ac.uk ---
I was sufficiently confused having read the Standard to persuade Dr John Reid
to submit a request for clarification to J3, the Fortran Standards Committee.

The request is at https://j3-fortran.org/doc/year/24/24-158.txt and the
response, recently given, is at https://j3-fortran.org/doc/year/24/24-179.txt

The conclusion is that the J3 believes that evaluating R*Z as
cmplx(R*real(Z),R*aimag(Z)) is fully standard compliant (and most other
compilers do take this route). The main argument is that IEEE-754 says nothing
whatsoever about the complex type. So it is not a matter of getting the wrong
answer fast, merely an alternative correct answer fast, in a world in which
multiple correct answers exist. The optimisation which Annex G of the C
Standard suggests Fortran does not prohibit.

Reply via email to