Re: FINAL subroutines

2022-01-28 Thread Paul Richard Thomas via Fortran
Hi Salvatore, That's correct. It's what ifort does too. Thus far I have found only one or two minor niggles with the Intel implementation of finalization. Since, as often or not, the two compilers are frequently used by the same users, I will attempt to make them compliant with one another. I will

Re: FINAL subroutines

2022-01-28 Thread Salvatore Filippone via Fortran
So, you are saying that three calls is the correct number, one for the LHS, one for the RHS, and one for the deallocation in the main program. I have (re)-read the standard, I would concur with your interpretation. On Thu, Jan 27, 2022 at 11:10 PM Paul Richard Thomas < paul.richard.tho...@gmail.co

Re: FINAL subroutines

2022-01-27 Thread Paul Richard Thomas via Fortran
Hi Salvatore, My reading of F2018: 7.5.6.3 "When finalization occurs" is that three calls is correct. (i) Paragraph 1 stipulates that the 'var' expression be evaluated before the reallocation and intrinsic assignment; (ii)stipulates that the function result be finalised "the result is finalized a

Re: FINAL subroutines

2022-01-26 Thread Salvatore Filippone via Fortran
One more data point: Cray FTN issues TWO calls to the FINAL. Which begs the question: what is the correct number of calls one, two or three? Salvatore fsalvato@daint102:/project/prce01/fsalvato/NUMERICAL/PSBLAS/V4/psblas4/test/newstuff> ftn --version Cray Fortran : Version 11.0.0 fsalvato@daint102

Re: FINAL subroutines

2022-01-26 Thread Paul Richard Thomas via Fortran
Hi Jerry, I am trying to fix the failure of my latest patch with this very test case. Otherwise it fixes most of the remaining dependencies in PR37336. At a pinch, I could submit the earlier patch that Andrew mentions and work from there. However, you will note that it does miss one of the finali

Re: FINAL subroutines

2022-01-26 Thread Jerry D via Fortran
Is there any reason these patches can not be applied and use this test as a test case? Regards, Jerry On 1/24/22 8:11 AM, Salvatore Filippone via Fortran wrote: Thanks a lot (yes, I suspected both gfortran and intel were wrong, precisely because I could see why you'd need two FINAL calls, but

Re: FINAL subroutines

2022-01-24 Thread Salvatore Filippone via Fortran
Thanks a lot (yes, I suspected both gfortran and intel were wrong, precisely because I could see why you'd need two FINAL calls, but not three). Salvatore On Mon, Jan 24, 2022 at 4:45 PM Andrew Benson wrote: > Hi Salvatore, > > This looks like it's related to some of the missing finalization >

Re: FINAL subroutines

2022-01-24 Thread Andrew Benson via Fortran
Hi Salvatore, This looks like it's related to some of the missing finalization functionality (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37336). Paul has some patches (e.g. https://gcc.gnu.org/pipermail/fortran/2022-January/057415.html) which implement most of the missing functionality. With

Re: FINAL subroutines

2022-01-24 Thread Salvatore Filippone via Fortran
And here is the code embedded as text sorry about sending an attachment that was purged - testfinal.f90 - module test_type_mod type :: my_test_type integer, allocatable :: i contains final :: delete_test_type end type my_test_t