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

* [Bug fortran/104382] Finalization of parent components not compliant with standard
  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 ` pault at gcc dot gnu.org
  2022-02-07 15:49 ` anlauf at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pault at gcc dot gnu.org @ 2022-02-07 11:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Paul Thomas <pault at gcc dot gnu.org> ---
(In reply to Paul Thomas from comment #0)
> Created attachment 52349 [details]
> 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
 I now discover that NAG 7.1 behaves the same way as gfortran.

Paul

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

* [Bug fortran/104382] Finalization of parent components not compliant with standard
  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
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: anlauf at gcc dot gnu.org @ 2022-02-07 15:49 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from anlauf at gcc dot gnu.org ---
crayftn 11 & 12 output:

 destructor4(complicated) 2*2.
 destructor5 (simple2) 5
 destructor5 (simple2) 6
 destructor2(simple) 2*1
 destructor4(complicated) 4.,  5.
 destructor5 (simple2) -1
 destructor5 (simple2) -2
 destructor2(simple) 3,  4
 final_count after assignment =  8
 destructor4(complicated) 4.,  5.
 destructor5 (simple2) -1
 destructor5 (simple2) -2
 destructor2(simple) 3,  4
 final_count after deallocation =  12

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

* [Bug fortran/104382] Finalization of parent components not compliant with standard
  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
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pault at gcc dot gnu.org @ 2022-02-07 15:54 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Paul Thomas <pault at gcc dot gnu.org> ---
(In reply to anlauf from comment #2)
> crayftn 11 & 12 output:
> 
>  destructor4(complicated) 2*2.
>  destructor5 (simple2) 5
>  destructor5 (simple2) 6
>  destructor2(simple) 2*1
>  destructor4(complicated) 4.,  5.
>  destructor5 (simple2) -1
>  destructor5 (simple2) -2
>  destructor2(simple) 3,  4
>  final_count after assignment =  8
>  destructor4(complicated) 4.,  5.
>  destructor5 (simple2) -1
>  destructor5 (simple2) -2
>  destructor2(simple) 3,  4
>  final_count after deallocation =  12

That seems to make a majority vote for the present gfortran behaviour then.

Thanks

Paul

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

* [Bug fortran/104382] Finalization of parent components not compliant with standard
  2022-02-04 12:49 [Bug fortran/104382] New: Finalization of parent components not compliant with standard pault at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  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
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2022-08-10  7:40 UTC (permalink / raw)
  To: gcc-bugs

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

Thomas Koenig <tkoenig at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tkoenig at gcc dot gnu.org

--- Comment #4 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
To add some variety to the tests, nagfor gives

 destructor4(complicated)   2.0000000   2.0000000
 destructor5 (simple2) 5
 destructor5 (simple2) 6
 destructor2(simple) 1 1
 final_count after assignment =  4
 destructor4(complicated)   4.0000000   5.0000000
 destructor5 (simple2) -1
 destructor5 (simple2) -2
 destructor2(simple) 3 4
 final_count after deallocation =  8

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

* [Bug fortran/104382] Finalization of parent components not compliant with standard
  2022-02-04 12:49 [Bug fortran/104382] New: Finalization of parent components not compliant with standard pault at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  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
  6 siblings, 0 replies; 8+ messages in thread
From: paul.richard.thomas at gmail dot com @ 2022-08-11  6:21 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from paul.richard.thomas at gmail dot com <paul.richard.thomas at gmail dot com> ---
Hi Thomas,

My stepping out of gfortran activities has been for rather longer than I
expected. I had hoped to have completed the finalization work by now and to
have got on with fixing PDTs.

I will try to find the time over the summer because it is evident that a
sufficient number of colleagues are on vacation that sustaining the pace of
work might be difficult :-)

I hope that all is well with you.

Paul


On Wed, 10 Aug 2022 at 08:40, tkoenig at gcc dot gnu.org <
gcc-bugzilla@gcc.gnu.org> wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104382
>
> Thomas Koenig <tkoenig at gcc dot gnu.org> changed:
>
>            What    |Removed                     |Added
>
> ----------------------------------------------------------------------------
>                  CC|                            |tkoenig at gcc dot
> gnu.org
>
> --- Comment #4 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
> To add some variety to the tests, nagfor gives
>
>  destructor4(complicated)   2.0000000   2.0000000
>  destructor5 (simple2) 5
>  destructor5 (simple2) 6
>  destructor2(simple) 1 1
>  final_count after assignment =  4
>  destructor4(complicated)   4.0000000   5.0000000
>  destructor5 (simple2) -1
>  destructor5 (simple2) -2
>  destructor2(simple) 3 4
>  final_count after deallocation =  8
>
> --
> You are receiving this mail because:
> You reported the bug.

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

* [Bug fortran/104382] Finalization of parent components not compliant with standard
  2022-02-04 12:49 [Bug fortran/104382] New: Finalization of parent components not compliant with standard pault at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  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
  6 siblings, 0 replies; 8+ messages in thread
From: pault at gcc dot gnu.org @ 2022-11-28 15:28 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Paul Thomas <pault at gcc dot gnu.org> ---
(In reply to Thomas Koenig from comment #4)
> To add some variety to the tests, nagfor gives
> 
>  destructor4(complicated)   2.0000000   2.0000000
>  destructor5 (simple2) 5
>  destructor5 (simple2) 6
>  destructor2(simple) 1 1
>  final_count after assignment =  4
>  destructor4(complicated)   4.0000000   5.0000000
>  destructor5 (simple2) -1
>  destructor5 (simple2) -2
>  destructor2(simple) 3 4
>  final_count after deallocation =  8

The current version of the finalizer patch gives the same result as nagfor.

Cheers

Paul

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

* [Bug fortran/104382] Finalization of parent components not compliant with standard
  2022-02-04 12:49 [Bug fortran/104382] New: Finalization of parent components not compliant with standard pault at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2022-11-28 15:28 ` pault at gcc dot gnu.org
@ 2023-03-18 17:31 ` pault at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: pault at gcc dot gnu.org @ 2023-03-18 17:31 UTC (permalink / raw)
  To: gcc-bugs

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

Paul Thomas <pault at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #7 from Paul Thomas <pault at gcc dot gnu.org> ---
Closing as fixed

^ 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).