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

Nathaniel Shead <nshead at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |nshead at gcc dot 
gnu.org

--- Comment #7 from Nathaniel Shead <nshead at gcc dot gnu.org> ---
Sorry for the breakage.  Looks like I missed walking DECL_ARGUMENTS of a
FUNCTION_DECL relies on this; the following patch fixes the minimal reproducers
of both this and PR 121935, but I'll see if there's any more checking I can do.
 Otherwise I guess I'll revert the last patch and see if there's another
approach.

diff --git a/gcc/ipa-free-lang-data.cc b/gcc/ipa-free-lang-data.cc
index 41afc6ec82f..8196cab6079 100644
--- a/gcc/ipa-free-lang-data.cc
+++ b/gcc/ipa-free-lang-data.cc
@@ -735,7 +735,8 @@ find_decls_types_r (tree *tp, int *ws, void *data)

       if (TREE_CODE (t) == FUNCTION_DECL)
         {
-          fld_worklist_push (DECL_ARGUMENTS (t), fld);
+          for (tree arg = DECL_ARGUMENTS (t); arg; arg = DECL_CHAIN (arg))
+            fld_worklist_push (arg, fld);
           fld_worklist_push (DECL_RESULT (t), fld);
         }
       else if (TREE_CODE (t) == FIELD_DECL)

Reply via email to