Re: [Patch, fortran] PR104272 - finalizer gets called during allocate

2023-04-05 Thread Harald Anlauf via Fortran
Hi Paul, On 4/5/23 08:53, Paul Richard Thomas via Gcc-patches wrote: Hi All, This is a first in my recent experience - a very old bug that produces too many finalizations! It results from a bit of a fix up, where class objects are allocated using the derived typespec, rather than a source or mo

Re: [Patch, fortran] PR104272 - finalizer gets called during allocate

2023-04-05 Thread Harald Anlauf via Fortran
On 4/5/23 20:50, Harald Anlauf via Gcc-patches wrote: can you have a look again at the logic in the hunk touching trans-stmt.cc (gfc_trans_allocate)?  I haven't checked in detail, but it seems possible that you get a stale tmp in the gfc_prepend_expr_to_block if (code->ext.alloc.expr3_not_explici

Re: [Patch, fortran] PR104272 - finalizer gets called during allocate

2023-04-05 Thread Paul Richard Thomas via Fortran
Hi Harald, Quite right - good spot. There was an 'else' that turned out to be unnecessary. Thanks Paul On Wed, 5 Apr 2023 at 19:50, Harald Anlauf wrote: > Hi Paul, > > On 4/5/23 08:53, Paul Richard Thomas via Gcc-patches wrote: > > Hi All, > > > > This is a first in my recent experience - a