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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code

--- Comment #10 from Richard Biener <rguenth at gcc dot gnu.org> ---
likely triggered by the INTENT(out), it looks like gfortran fails to properly
name-lookup a variable of the same name as the function?  The intent is likely
to have the return value assigned by CALERF_r8.  So it also looks like gfortran
miscompiles such testcase.

The following sketches a miscompiled testcase (but my fortran fu is too weak to
make it compile)

PROCEDURE Y (Z)
      real(8), intent(out) :: Z
      Z = 1.
END PROCEDURE Y
FUNCTION X
      real(8) :: X
      CALL Y (X)
END FUNCTION X
PROGRAM TEST
    real(8) :: Z
    Z = X();
    if (Z.ne.1.) STOP 1
END

Reply via email to