This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, Fortran] PR54556 - fix (4.6/4.7/) 4.8 regression: wrong code with implicit_pure procedures
- From: Mikael Morin <mikael dot morin at sfr dot fr>
- To: Tobias Burnus <burnus at net-b dot de>
- Cc: gcc patches <gcc-patches at gcc dot gnu dot org>, gfortran <fortran at gcc dot gnu dot org>
- Date: Thu, 13 Sep 2012 16:51:03 +0200
- Subject: Re: [Patch, Fortran] PR54556 - fix (4.6/4.7/) 4.8 regression: wrong code with implicit_pure procedures
- References: <5051D31F.8090408@net-b.de>
On 13/09/2012 14:35, Tobias Burnus wrote:
> gfortran wrongly marks some procedures as implicit_pure which aren't
> pure. implicit_pure exists since 2011-01-08 (= GCC 4.6), but was only
> used internally (FE optimization and trans*.c to avoid temporaries).
> Since 2012-08-28, implicit_pure also implies DECL_PURE_P. The later
> change exposes a bug and miscompiles CP2K.
>
> The reason for the the bug is that gfc_impure_variable() checks at some
> point whether it is invoked in a PURE procedure. For implicit_pure
> procedures, the answer is no - thus that check never triggered. I have
> now removed the check - the callee already takes care of that. (Which is
> also implied by the function name.)
>
> I additionally allow VALUE for implicit_pure. That's in line with PURE
> where VALUE is allowed since Fortran 2008. (I think since F2008's first
> technical corriendum.)
>
> Build and regtested on x86-64-gnu-linux.
> OK for the trunk and for the 4.6/4.7 branches?
>
> Tobias,
> who hopes that no additional implicit_pure bugs exist.
OK, thanks.