https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108451

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kargl at gcc dot gnu.org

--- Comment #4 from kargl at gcc dot gnu.org ---
(In reply to Jakub Jelinek from comment #3)
> 2023-02-03  Jakub Jelinek  <ja...@redhat.com>
> 
>       PR fortran/108451
>       * trans-decl.cc (gfc_trans_use_stmts): Call clear_slot before
>       doing continue.
> 
> --- gcc/fortran/trans-decl.cc.jj      2023-01-16 11:52:16.146733136 +0100
> +++ gcc/fortran/trans-decl.cc 2023-02-03 14:41:40.503322954 +0100
> @@ -5350,7 +5350,11 @@ gfc_trans_use_stmts (gfc_namespace * ns)
>             /* Sometimes, generic interfaces wind up being over-ruled by a
>                local symbol (see PR41062).  */
>             if (!st->n.sym->attr.use_assoc)
> -             continue;
> +             {
> +               *slot = error_mark_node;
> +               entry->decls->clear_slot (slot);
> +               continue;
> +             }
>  
>             if (st->n.sym->backend_decl
>                 && DECL_P (st->n.sym->backend_decl)
> 
> fixes the regression (fairly obvious bug).  Am not adding testcase because
> given #c1 I'm  really not sure if the testcase is valid or not.  Anyway, GCC
> 12 accept z1 and z2 and reject z3, so IMHO this bug should be split into the
> checking ICE which the above patch should fix and any possible
> accepts-invalid which doesn't look like a regression.

The code is invalid Fortran.  The module m does not contain
an entity named 'pdtt'.  If I had to guess the 'pdt' portion
of the name means 'parameterized derived type' and the last
't' means type 't'.  This is likely an internal symbol that
has escaped.  gfortran's support for PDTs is broken.

I agree with you about committing your fix for the ICE and
opening a new PR about the PDT issue.  Note there are already
several open PRs, so this might end up as a dup.

Reply via email to