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

--- Comment #2 from anlauf at gcc dot gnu.org ---
(In reply to Andrew Pinski from comment #1)
> I suspect this might be a front end bug. The decls for the two functions
> should be the same but I think they are different and that is causing the
> issue.

Can you give some hint where to look for?  And what is relevant?
(Note that I have zero experience with lto).

In trans-decl.cc::build_function_decl we have:

2507      /* Initialize DECL_EXTERNAL and TREE_PUBLIC before calling
decl_attributes;
2508         TREE_PUBLIC specifies whether a function is globally addressable
(i.e.
2509         the opposite of declaring a function as static in C).  */
2510      DECL_EXTERNAL (fndecl) = 0;
...
2518      if (!current_function_decl
2519          && !sym->attr.entry_master && !sym->attr.is_main_program
2520          && (sym->attr.access != ACCESS_PRIVATE || sym->binding_label
2521              || sym->attr.public_used))
2522        TREE_PUBLIC (fndecl) = 1;

For procedures with C binding (here:S1):

(gdb) p sym->binding_label
$43 = 0x7ffff682b130 "s1"

so we declare it globally addressable.

What else do we need?

Reply via email to