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

            Bug ID: 91316
           Summary: Derived type finalization failing
           Product: gcc
           Version: 9.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jrfsousa at hotmail dot com
  Target Milestone: ---

Created attachment 46653
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46653&action=edit
Code exhibiting behavior

Some situations where derived type finalization is not working

Tested with gfortran 5.4.0 and 9.1.0

Commented output:

 enter main
 DESTROY:           -1
 enter final_s1
 DESTROY:           -1
 f1:            1
 DESTROY:            1
 exit final_s1
 enter final_s2
 DESTROY:           -1
 f2:            2
 DESTROY:            2
 exit final_s2
 enter final_s3

***
* Expected initial finalization of the assignment target
* Expected finalization of any temporaries created
***

 f3:            3
 DESTROY:            3
 exit final_s3
 enter final_s4
 f4:            4

***
* Finalization does not get called at all
***

 exit final_s4
 f0:            0
 DESTROY:            0
 exit main

Thank you all for a great compiler!

Best regards,
José Rui

Reply via email to