public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/104382] New: Finalization of parent components not compliant with standard
@ 2022-02-04 12:49 pault at gcc dot gnu.org
  2022-02-07 11:51 ` [Bug fortran/104382] " pault at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: pault at gcc dot gnu.org @ 2022-02-04 12:49 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 104382
           Summary: Finalization of parent components not compliant with
                    standard
           Product: gcc
           Version: 12.0
            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 52349
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52349&action=edit
Testcase for the problems

With all branches that feature finalization, the attached testcase outputs:
 final_count after assignment =            0
 destructor4(complicated)   4.00000000       5.00000000    
 destructor5 (simple2)          -1
 destructor5 (simple2)          -2
 destructor2(simple)           3           4
 final_count after deallocation =            4

Ifort, on the other hand, outputs:
 destructor4(complicated)   2.000000       2.000000    
 destructor5 (simple2)           5
 destructor5 (simple2)           6
 destructor1(simple)           1
 destructor1(simple)           1
 final_count after assignment =            5
 destructor4(complicated)   4.000000       5.000000    
 destructor5 (simple2)          -1
 destructor5 (simple2)          -2
 destructor1(simple)           3
 destructor1(simple)           4
 final_count after deallocation =           10

There are two problems:
(i) The finalization of 'var' prior to reallocation is not ocurring. This is
fixed by the patch that I posted to the list yesterday.

(ii) The parent component is not being treated as a component, as mandated by
F2018 7.5.6.2/1(3). Ifort is behaving correctly.

Paul

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-03-18 17:31 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-04 12:49 [Bug fortran/104382] New: Finalization of parent components not compliant with standard pault at gcc dot gnu.org
2022-02-07 11:51 ` [Bug fortran/104382] " pault at gcc dot gnu.org
2022-02-07 15:49 ` anlauf at gcc dot gnu.org
2022-02-07 15:54 ` pault at gcc dot gnu.org
2022-08-10  7:40 ` tkoenig at gcc dot gnu.org
2022-08-11  6:21 ` paul.richard.thomas at gmail dot com
2022-11-28 15:28 ` pault at gcc dot gnu.org
2023-03-18 17:31 ` pault at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).