aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2014-04-04 20:02:31 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2014-04-04 18:02:31 +0000
commit8fe91ca80ebe76ddc0f66674061209dd6a5e7557 (patch)
treed5d626b8502a78d19963191e0451f75ee3853ad9 /gcc/ipa.c
parent88d946326b489b2235f8ebd0c7d95a5803018740 (diff)
downloadgcc-8fe91ca80ebe76ddc0f66674061209dd6a5e7557.zip
gcc-8fe91ca80ebe76ddc0f66674061209dd6a5e7557.tar.gz
gcc-8fe91ca80ebe76ddc0f66674061209dd6a5e7557.tar.bz2
re PR lto/59626 (/usr/include/bits/unistd.h:173:1: error: inlining failed in call to always_inline 'readlinkat': recursive inlining)
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. * gcc.dg/lto/pr59626_0.c: New testcase. * gcc.dg/lto/pr59626_1.c: New testcase. From-SVN: r209123
Diffstat (limited to 'gcc/ipa.c')
-rw-r--r--gcc/ipa.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/gcc/ipa.c b/gcc/ipa.c
index 435fff0..c766876 100644
--- a/gcc/ipa.c
+++ b/gcc/ipa.c
@@ -139,7 +139,10 @@ process_references (struct ipa_ref_list *list,
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. */
@@ -191,7 +194,10 @@ walk_polymorphic_call_targets (pointer_set_t *reachable_call_targets,
/* 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
@@ -491,6 +497,12 @@ symtab_remove_unreachable_nodes (bool before_inlining_p, FILE *file)
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);