http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60854

--- Comment #3 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
OK, the problem is that we see the reference to alias and decide to keep the
alias for future inlining. But when processing the refernce from alias to
function itself, we throw it away. We need to keep the body, too ;)

(the existing node->alias check actually cares about oposite case where we want
to keep weakrefs)

Index: ipa.c
===================================================================
--- ipa.c       (revision 209435)
+++ ipa.c       (working copy)
@@ -138,7 +138,7 @@ process_references (struct ipa_ref_list
       symtab_node *node = ref->referred;

       if (node->definition && !node->in_other_partition
-         && ((!DECL_EXTERNAL (node->decl) || node->alias)
+         && ((!DECL_EXTERNAL (node->decl) || node->alias || ref->use ==
IPA_REF_ALIAS)
              || (((before_inlining_p
                    && (cgraph_state < CGRAPH_STATE_IPA_SSA
                        || !lookup_attribute ("always_inline",

Reply via email to