+2017-06-15 Jan Hubicka <hubicka@ucw.cz>
+ Thomas Preud'homme <thomas.preudhomme@arm.com>
+
+ PR lto/69866
+ * lto-symtab.c (lto_symtab_merge_symbols): Drop useless definitions
+ that resolved externally.
+
2017-05-23 Jan Hubicka <hubicka@ucw.cz>
* lto.c (do_whole_program_analysis): Replace inline_free_summary
/* Be sure that we never try to duplicate partitioned symbol
or add external symbol. */
- gcc_assert (c != SYMBOL_EXTERNAL
+ gcc_assert ((c != SYMBOL_EXTERNAL || node->alias)
&& (c == SYMBOL_DUPLICATE || !symbol_partitioned_p (node)));
part->symbols++;
if (tgt)
node->resolve_alias (tgt, true);
}
+ /* If the symbol was preempted outside IR, see if we want to get rid
+ of the definition. */
+ if (node->analyzed
+ && !DECL_EXTERNAL (node->decl)
+ && (node->resolution == LDPR_PREEMPTED_REG
+ || node->resolution == LDPR_RESOLVED_IR
+ || node->resolution == LDPR_RESOLVED_EXEC
+ || node->resolution == LDPR_RESOLVED_DYN))
+ {
+ DECL_EXTERNAL (node->decl) = 1;
+ /* If alias to local symbol was preempted by external definition,
+ we know it is not pointing to the local symbol. Remove it. */
+ if (node->alias
+ && !node->weakref
+ && !node->transparent_alias
+ && node->get_alias_target ()->binds_to_current_def_p ())
+ {
+ node->alias = false;
+ node->remove_all_references ();
+ node->definition = false;
+ node->analyzed = false;
+ node->cpp_implicit_alias = false;
+ }
+ else if (!node->alias
+ && node->definition
+ && node->get_availability () <= AVAIL_INTERPOSABLE)
+ {
+ if ((cnode = dyn_cast <cgraph_node *> (node)) != NULL)
+ cnode->reset ();
+ else
+ {
+ node->analyzed = node->definition = false;
+ node->remove_all_references ();
+ }
+ }
+ }
if (!(cnode = dyn_cast <cgraph_node *> (node))
|| !cnode->clone_of
+2017-06-15 Thomas Preud'homme <thomas.preudhomme@arm.com>
+
+ PR lto/69866
+ * gcc.dg/lto/pr69866_0.c: New test.
+ * gcc.dg/lto/pr69866_1.c: Likewise.
+
2017-06-15 Jozef Lawrynowicz <jozef.l@somniumtech.com>
PR target/78818