Hi All,

I fixed the new wrinkle found by Damian and pushed the patch as r16-4627.

Thanks to all for the help on this one.

Regards

Paul

On Fri, 24 Oct 2025 at 20:23, Harald Anlauf <[email protected]> wrote:
>
> Hi Paul!
>
> > Gesendet: Freitag, 24. Oktober 2025 um 13:35
> > Von: "Paul Richard Thomas" <[email protected]>
> > An: "Harald Anlauf" <[email protected]>
> > CC: [email protected], [email protected], [email protected]
> > Betreff: Re: Re: [Patch, fortran] PR122290 - PDT - gfortan rejects real 
> > intrinsic in default initialization & generic binding
> >
> > Hi Harald,
> >
> > Many thanks for giving the patch a thorough going over. The attached
> > version fixes the "Invalid read of size 8" problem that you
> > identified. While I was about it, I checked all the PDT testcases
> > using MALLOC_PERTURB_, which I should have done a long time ago.
> > pdt_19/_42/_46/_50.f03 all have a problem of one kind or another. I
> > will take a quick look to see if I can find the problems, which are
> > almost certainly generated in trans-array.cc (structure_alloc_comps).
> > However, the PDT parts of this function will all have to change, when
> > I fix PR82649. This will likely be the last PDT PR that I tackle since
> > it involves a change of representation, rather than parse/resolution
> > fixes.
> >
> > > s/initailizers/initializers/
> > > s/enities/entities/
> > >
> >
> > Fixed.
> >
> > > > > ==8558== Invalid read of size 8
> > > > > ==8558==    at 0xB1EB36: get_kind(bt, gfc_expr*, char const*, int)
> > > > > (simplify.cc:133)
> > > > > ==8558==    by 0xB31558: gfc_simplify_real(gfc_expr*, gfc_expr*)
> > > > > (simplify.cc:7547)
> > > > > ==8558==    by 0xA6E149: do_simplify(gfc_intrinsic_sym*, gfc_expr*)
> > > > > (intrinsic.cc:4895)
> > > > > ==8558==    by 0xA7A49A: gfc_intrinsic_func_interface(gfc_expr*, int)
> > > > > (intrinsic.cc:5298)
> > > > > ==8558==    by 0xAEED5B: resolve_unknown_f(gfc_expr*) 
> > > > > (resolve.cc:3106)
> > > > > ==8558==    by 0xAEFCBE: resolve_function(gfc_expr*) (resolve.cc:3533)
> > > > > ==8558==    by 0xAFAFE8: gfc_resolve_expr(gfc_expr*) (resolve.cc:8181)
> > > > > ==8558==    by 0xB099C0: gfc_resolve_code(gfc_code*, gfc_namespace*)
> > > > > (resolve.cc:13878)
> > > > > ==8558==    by 0xB18EDB: resolve_codes(gfc_namespace*) 
> > > > > (resolve.cc:19897)
> > > > > ==8558==    by 0xB18FAC: gfc_resolve(gfc_namespace*) 
> > > > > (resolve.cc:19932)
> > > > > ==8558==    by 0xADC576: resolve_all_program_units(gfc_namespace*)
> > > > > (parse.cc:7481)
> > > > > ==8558==    by 0xADCD85: gfc_parse_file() (parse.cc:7741)
> > > > >
> > > > > Maybe this can be traced back to a code path where a variable
> > > > > is not suitably initialized`
> >
> > The fix of this problem required the move of the PDT kind conversion
> > from simplify.cc to primary.cc and taking the gfc_replace_expression
> > call to outside of the reference chain walk.
>
> Nice!  This indeed fixes the issue here, too.
>
> > As before, regtests on FC42/x86_64. OK for mainline?
>
> Yes, this is OK now.
>
> Thanks for the patch!
>
> Harald
>
> > Paul
> >

Reply via email to