/* Localize comdats.
- Copyright (C) 2014-2015 Free Software Foundation, Inc.
+ Copyright (C) 2014-2019 Free Software Foundation, Inc.
This file is part of GCC.
continue;
}
- /* One COMDAT group can not hold both variables and functions at
+ /* One COMDAT group cannot hold both variables and functions at
a same time. For now we just go to BOTTOM, in future we may
invent special comdat groups for this case. */
if (cgraph_node * cn = dyn_cast <cgraph_node *> (symbol2))
{
- /* Thunks can not call across section boundary. */
+ /* Thunks cannot call across section boundary. */
if (cn->thunk.thunk_p)
newgroup = propagate_comdat_group (symbol2, newgroup, map);
/* If we see inline clone, its comdat group actually
symtab_node *head = (symtab_node *)head_p;
gcc_assert (!symbol->get_comdat_group ());
- symbol->set_comdat_group (head->get_comdat_group ());
- symbol->add_to_same_comdat_group (head);
+ if (symbol->real_symbol_p ())
+ {
+ symbol->set_comdat_group (head->get_comdat_group ());
+ symbol->add_to_same_comdat_group (head);
+ }
return false;
}
/* Mark the symbol so we won't waste time visiting it for dataflow. */
symbol->aux = (symtab_node *) (void *) 1;
}
- /* See symbols that can not be privatized to comdats; that is externally
+ /* See symbols that cannot be privatized to comdats; that is externally
visible symbols or otherwise used ones. We also do not want to mangle
user section names. */
else if (symbol->externally_visible
bool
pass_ipa_comdats::gate (function *)
{
- return optimize;
+ return HAVE_COMDAT_GROUP;
}
} // anon namespace