From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3D6A23858401; Fri, 2 Sep 2022 18:56:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3D6A23858401 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1662144995; bh=58tHmFJaX+9NevgR+DexmFU5kkftovidb3ttti750QA=; h=From:To:Subject:Date:From; b=OlcjZYWmuEmKwdqPIjL06Qs7nSle988fbNnMzx4eqd5/rlQiZQSSAoomAWGx6N3Ya wBezmLQYmkNkqlTc6tXyntMvCCLdwufRpLDGS8pZB8uLJZbfd2b+PEuayLM4DCPKbE RJH1DM8r7mAAoXDzRd7KdqFPQ+93CYJaoeKxhFl0= From: "mikael at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/106817] New: clobber ordering problem when an actual intent(in) argument depends on the value of an intent(out) argument Date: Fri, 02 Sep 2022 18:56:35 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: mikael at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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 Bug ID: 106817 Summary: clobber ordering problem when an actual intent(in) argument depends on the value of an intent(out) argument Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: mikael at gcc dot gnu.org Target Milestone: --- module m implicit none contains subroutine copy(in, out) integer, intent(in) :: in integer, intent(out) :: out out =3D in end subroutine copy end module m program p use m implicit none integer :: a a =3D 3 call copy(a+1, a) if (a /=3D 4) stop 1 end program p The in value (a+1) depends on the value of a, but a is clobbered at the beginning of the call to copy, so we should make sure that we have evaluated a+1 before generating the clobber.=