From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B8091385AC1F; Mon, 10 Oct 2022 20:53:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B8091385AC1F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1665435215; bh=nt4jTwSOZIT3g5p46v947JFByS/K4kFrak/FJquS/k4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ipiouIsR4JwoCO+q6O3w/JJtmHXMQvLHeG2znuO5Xj9857vBoGQhwJuv3k75pVCh1 0gi32neUMETZchSzJsqg+5AW/huJ26h29BPVR0LNyfuAFyNTfDnPxcgzOHUNTz3toq Jk9ZL7MoNt0HfSryJoA+cX+56Es5ZibDQKm4catg= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/106817] clobber ordering problem when an actual intent(in) argument depends on the value of an intent(out) argument Date: Mon, 10 Oct 2022 20:53:34 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: unknown X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: mikael at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106817 --- Comment #9 from CVS Commits --- The releases/gcc-10 branch has been updated by Mikael Morin : https://gcc.gnu.org/g:b394ebd90e1f9c125216c70beedf97d6d8739773 commit r10-11029-gb394ebd90e1f9c125216c70beedf97d6d8739773 Author: Mikael Morin Date: Sat Sep 3 11:58:47 2022 +0200 fortran: Move clobbers after evaluation of all arguments [PR106817] For actual arguments whose dummy is INTENT(OUT), we used to generate clobbers on them at the same time we generated the argument reference for the function call. This was wrong if for an argument coming later, the value expression was depending on the value of the just- clobbered argument, and we passed an undefined value in that case. With this change, clobbers are collected separatedly and appended to the procedure call preliminary code after all the arguments have been evaluated. PR fortran/106817 gcc/fortran/ChangeLog: * trans-expr.c (gfc_conv_procedure_call): Collect all clobbers to their own separate block. Append the block of clobbers to the procedure preliminary block after the argument evaluation codes for all the arguments. gcc/testsuite/ChangeLog: * gfortran.dg/intent_optimize_4.f90: New test. (cherry picked from commit 29919bf3b6449bafd02e795abbb1966e3990c1fc)=