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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
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.

Reply via email to