Hi Mikael, Am 04.03.23 um 23:29 schrieb Mikael Morin: > Le 04/03/2023 à 22:20, Harald Anlauf a écrit : >> Hi Mikael, >> >> Am 04.03.23 um 18:09 schrieb Mikael Morin: >>> There was a comment about the old_symbol thing at the end of my previous >>> message: >>> https://gcc.gnu.org/pipermail/gcc-patches/2023-March/613354.html >> >> I think Tobias might be the better person to answer this. >> But when playing with variations of that else-branch, >> I always hit an issue with class_74.f90, where the class >> variables are not dummy arguments but local variables. >> >> E.g. take the following reduced testcase: >> >> subroutine foo >>    class(*)  :: y >>    dimension :: y(:,:) >>    pointer   :: y >> end subroutine foo >> >> So when we see the dimension but haven't seen the >> pointer (or allocatable) declaration, we appear to >> generate an error with bad consequences (ICE). >> >> If this is a resolution issue, maybe it can be fixed >> differently, but likely needs digging deeper.  With >> the patch as-is at least I do not see a memory leak >> in that context. >> > One of my suggestions was to fix it as attached. > It is probably more clear with an actual patch to look at. > It seems to work on your example and class_74 as well. This fix is great. I've included it in the revised patch. > It seems to also fix some valgrind errors on this example: >    subroutine foo >      pointer   :: y >      dimension :: y(:,:) >      class(*)  :: y >    end subroutine foo > I'm fine with that fix if it works for you. I've added this variant to class_74.f90, so it won't break without noticing. > I suggest waiting for next stage 1, but it's your call, you have the > green light from Steve anyway. I've chosen to push patch v3 (attached) after a further round of regtesting as r13-6497-g6aa1f40a326374 . > Thanks for your work. Many thanks for your very helpful review! Harald