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

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
Ah, the target:

  /* Build result decl and add to function_decl. */
  t = build_decl (UNKNOWN_LOCATION, RESULT_DECL, NULL_TREE, ptr_type_node);
  DECL_ARTIFICIAL (t) = 1;
  DECL_IGNORED_P (t) = 1;
  DECL_RESULT (decl) = t;

fails to set DECL_CONTEXT.  But I wonder whether we need a result decl at all
here.  Fix:

Index: gcc/config/i386/i386.c
===================================================================
--- gcc/config/i386/i386.c      (revision 269678)
+++ gcc/config/i386/i386.c      (working copy)
@@ -32572,6 +32572,7 @@ make_resolver_func (const tree default_d
     }
   /* Build result decl and add to function_decl. */
   t = build_decl (UNKNOWN_LOCATION, RESULT_DECL, NULL_TREE, ptr_type_node);
+  DECL_CONTEXT (t) = decl;
   DECL_ARTIFICIAL (t) = 1;
   DECL_IGNORED_P (t) = 1;
   DECL_RESULT (decl) = t;

Reply via email to