aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-inline.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2019-11-13 14:29:27 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2019-11-13 13:29:27 +0000
commit2895b172d56c355373b64517a3298a01a2f10ec0 (patch)
treee197a46b63ed6c23cdfd2cf7bdb2f63b795464ad /gcc/ipa-inline.c
parent237957cc2c1818f30207f02747a880bd1cd28d0b (diff)
downloadgcc-2895b172d56c355373b64517a3298a01a2f10ec0.zip
gcc-2895b172d56c355373b64517a3298a01a2f10ec0.tar.gz
gcc-2895b172d56c355373b64517a3298a01a2f10ec0.tar.bz2
ipa-inline.c (ipa_inline): Check that function is defined before flattening.
* ipa-inline.c (ipa_inline): Check that function is defined before flattening. * gcc.c-torture/compile/flatten.c: New testcase. From-SVN: r278139
Diffstat (limited to 'gcc/ipa-inline.c')
-rw-r--r--gcc/ipa-inline.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c
index df6f991..f3e880c 100644
--- a/gcc/ipa-inline.c
+++ b/gcc/ipa-inline.c
@@ -2564,8 +2564,9 @@ ipa_inline (void)
for (i = nnodes - 1, j = i; i >= 0; i--)
{
node = order[i];
- if (lookup_attribute ("flatten",
- DECL_ATTRIBUTES (node->decl)) != NULL)
+ if (node->definition
+ && lookup_attribute ("flatten",
+ DECL_ATTRIBUTES (node->decl)) != NULL)
order[j--] = order[i];
}