From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 53CEB3858CDA; Mon, 10 Jul 2023 18:26:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 53CEB3858CDA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1689013588; bh=sY/nLaMCtySkBTEuOsrECgntKYQ5Ep6kAK1kAj2RCTA=; h=From:To:Subject:Date:From; b=WMxhS5pPRmzl9vfO5e0F7bVop9C13zih8WBVx5vLWn6qJ+K/lde8mJVDiCetOY0rZ VhbKlL9ToGY/Msicm0Oj9BdKQm86/aghaKbRStgn2Hdkug4Se22woHvneLPTaudshN KOIDoRiKWtRU3BjItkWezAIXmmxoc70+IdJq3t4o= From: "mikael at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/110618] New: Dependency between arguments when one is allocatable array whose dummy is intent(out) Date: Mon, 10 Jul 2023 18:26:28 +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: 11.4.1 X-Bugzilla-Keywords: wrong-code 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 keywords bug_severity priority component assigned_to reporter cc dependson blocked 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=3D110618 Bug ID: 110618 Summary: Dependency between arguments when one is allocatable array whose dummy is intent(out) Product: gcc Version: 11.4.1 Status: UNCONFIRMED Keywords: wrong-code Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: mikael at gcc dot gnu.org CC: abensonca at gcc dot gnu.org, anlauf at gcc dot gnu.org, burnus at gcc dot gnu.org, kargl at gcc dot gnu.org, vladimir.fuka at gmail dot com Depends on: 92178 Blocks: 87142 Target Milestone: --- +++ This bug was initially created as a clone of Bug #92178 +++ PR 92178 has several cases of dependency between arguments when one of them= is deallocated before the call in the process of argument association. Here is another example which I don't want to handle there (and which I don= 't know how to fix). program p implicit none type t integer :: i end type t type u class(t), allocatable :: ta(:) end type u type(u), allocatable :: c(:) class(t), allocatable :: d(:) allocate(c, source =3D [u([t(1), t(3)]), u([t(4), t(9)])]) allocate(d, source =3D [t(1), t(5)]) call bar ( & allocated(c(d(1)%i)%ta), & d, & c(d(1)%i)%ta, & allocated (c(d(1)%i)%ta) & ) if (allocated (c(1)%ta)) stop 11 if (.not. allocated (c(2)%ta)) stop 12 contains subroutine bar (alloc, x, y, alloc2) logical :: alloc, alloc2 class(t), allocatable, intent(out) :: x(:) class(t), allocatable, intent(out) :: y(:) if (allocated (x)) stop 1 if (.not. alloc) stop 2 if (.not. alloc2) stop 3 end subroutine bar end Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D87142 [Bug 87142] Aliasing issue with overloaded assignment and allocatable components https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D92178 [Bug 92178] Segmentation fault after passing allocatable array as intent(ou= t) and its element as value into the same subroutine=