[patch, fortran] Fix PR 87352, far too many deallocations

Paul Richard Thomas paul.richard.thomas@gmail.com
Mon Apr 1 19:57:00 GMT 2019


Hi Thomas,

One quick way of reducing the problem would be to set _def_init to
NULL if there is nothing to initialize.

I have been meaning to tackle this myself but just have not had the
time of late. Day time work is keeping me too busy :-(

Paul

On Mon, 1 Apr 2019 at 19:56, Thomas Koenig <tkoenig@netcologne.de> wrote:
>
> Am 01.04.19 um 11:19 schrieb Jeremy Sanders:
> > Dear Thomas
> >
> > On 31/03/2019 18:10, Thomas Koenig wrote:
> >
> >> @Jeremy: Can you confirm that this fixes the excessive compile time
> >> and code size issue for you?
> >
> > The patch fixes for me the large problem which was the N^2 number of
> > deallocations. The compile time speed problem is also fixed. Thanks for
> > that!
>
> Good, so at least one part of the problem is solved (or will be as soon
> as this patch is committed).
>
> > However, I think there is a 2nd problem (maybe caused by the 1st commit
> > referenced by the bug), where large object files are produced.
>
> This sounds like https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84487 .
>
> > There is also very large stack usage. I think these are associated with
> > initialisation of the datatypes. It seems the code creates the object
> > with the allocation on the stack, marks the subarrays as unallocated,
> > then memcpys this into the allocated object. As the objects can be
> > large, this leads to large stack usage.
>
> That might be a consequence, yes.  This is not really my area of
> expertise, but I will at least take a look.
>
> Regards
>
>         Thomas
>


-- 
"If you can't explain it simply, you don't understand it well enough"
- Albert Einstein



More information about the Fortran mailing list