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

            Bug ID: 111674
           Summary: [13/14 regression] Failure to finalize an allocatable
                    subobject of a non-finalizable type
           Product: gcc
           Version: 13.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pault at gcc dot gnu.org
  Target Milestone: ---

Created attachment 56035
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56035&action=edit
Testcase demonstrating the bug

Introduced by r13-6747-gd7caf313525a46f200d7f5db1ba893f853774aee

See the attached testcase, which was developed to check F2018 compliance in the
Chivers/Sleightholme compliance tables.

gfortran correctly determines from 7.5.6.1 that y is not finalizable. However,
following the first paragraph in 7.5.6.3, the component y%aa should be
finalized before deallocation in the second assignment. 12-branch used to do
this but 13-branch and mainline currently do not.

Note, that 12-branch does not finalize x in its second assignment, as it
should.

Fortunately the fix is trivial and will be posted in the first comment.

Paul

Reply via email to