+2014-04-04 Jan Hubicka <hubicka@ucw.cz>
+
+ PR ipa/59626
+ * lto-cgraph.c (input_overwrite_node): Check that partitioning
+ flags are set only during streaming.
+ * ipa.c (process_references, walk_polymorphic_call_targets,
+ symtab_remove_unreachable_nodes): Drop bodies of always inline
+ after early inlining.
+ (symtab_remove_unreachable_nodes): Remove always_inline attribute.
+
2014-04-04 Jakub Jelinek <jakub@redhat.com>
Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
if (node->definition && !node->in_other_partition
&& ((!DECL_EXTERNAL (node->decl) || node->alias)
- || (before_inlining_p
+ || (((before_inlining_p
+ && (cgraph_state < CGRAPH_STATE_IPA_SSA
+ || !lookup_attribute ("always_inline",
+ DECL_ATTRIBUTES (node->decl)))))
/* We use variable constructors during late complation for
constant folding. Keep references alive so partitioning
knows about potential references. */
/* Prior inlining, keep alive bodies of possible targets for
devirtualization. */
if (n->definition
- && before_inlining_p)
+ && (before_inlining_p
+ && (cgraph_state < CGRAPH_STATE_IPA_SSA
+ || !lookup_attribute ("always_inline",
+ DECL_ATTRIBUTES (n->decl)))))
pointer_set_insert (reachable, n);
/* Even after inlining we want to keep the possible targets in the
node->alias = false;
node->thunk.thunk_p = false;
node->weakref = false;
+ /* After early inlining we drop always_inline attributes on
+ bodies of functions that are still referenced (have their
+ address taken). */
+ DECL_ATTRIBUTES (node->decl)
+ = remove_attribute ("always_inline",
+ DECL_ATTRIBUTES (node->decl));
if (!node->in_other_partition)
node->local.local = false;
cgraph_node_remove_callees (node);
node->thunk.thunk_p = bp_unpack_value (bp, 1);
node->resolution = bp_unpack_enum (bp, ld_plugin_symbol_resolution,
LDPR_NUM_KNOWN);
+ gcc_assert (flag_ltrans
+ || (!node->in_other_partition
+ && !node->used_from_other_partition));
}
/* Return string alias is alias of. */
node->same_comdat_group = (symtab_node *) (intptr_t) ref;
node->resolution = streamer_read_enum (ib, ld_plugin_symbol_resolution,
LDPR_NUM_KNOWN);
+ gcc_assert (flag_ltrans
+ || (!node->in_other_partition
+ && !node->used_from_other_partition));
return node;
}
+2014-04-04 Jan Hubicka <hubicka@ucw.cz>
+
+ PR ipa/59626
+ testcase by Richard Biener
+ * gcc.dg/lto/pr59626_0.c: New testcase.
+ * gcc.dg/lto/pr59626_1.c: New testcase.
+
2014-04-04 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
PR debug/60655
--- /dev/null
+/* { dg-lto-do run } */
+
+int __atoi (const char *) __asm__("atoi");
+extern inline __attribute__((always_inline,gnu_inline))
+int atoi (const char *x)
+{
+ return __atoi (x);
+}
+
+int bar (int (*)(const char *));
+
+int main()
+{
+ return bar (atoi);
+}
--- /dev/null
+int bar (int (*fn)(const char *))
+{
+ return fn ("0");
+}