From 8a4a6d2e844df54583cd8fac181586b10f63fe25 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Sun, 19 Nov 2017 20:58:12 +0100 Subject: [PATCH] re PR ipa/81360 (ice in estimate_edge_growth, at ipa-inline.h:86) PR ipa/81360 * ipa-inline.c (can_inline_edge_p): Also check that caller is optimized * gcc.c-torture/compile/pr81360.c: New testcase. From-SVN: r254937 --- gcc/ChangeLog | 5 +++++ gcc/ipa-inline.c | 3 ++- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.c-torture/compile/pr81360.c | 11 +++++++++++ 4 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.c-torture/compile/pr81360.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e955bece4b9..ae05dacf791 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2017-11-19 Jan Hubicka + + PR ipa/81360 + * ipa-inline.c (can_inline_edge_p): Also check that caller is optimized + 2017-11-19 Jan Hubicka PR ipa/83001 diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c index f4ce80ae2c6..4f1860fb284 100644 --- a/gcc/ipa-inline.c +++ b/gcc/ipa-inline.c @@ -324,7 +324,8 @@ can_inline_edge_p (struct cgraph_edge *e, bool report, e->inline_failed = CIF_BODY_NOT_AVAILABLE; inlinable = false; } - if (!early && !opt_for_fn (callee->decl, optimize)) + if (!early && (!opt_for_fn (callee->decl, optimize) + || opt_for_fn (caller->decl, optimize))) { e->inline_failed = CIF_FUNCTION_NOT_OPTIMIZED; inlinable = false; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ebdf42bea5f..3858caa59e0 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-11-19 Jan Hubicka + + PR ipa/81360 + * gcc.c-torture/compile/pr81360.c: New testcase. + 2017-11-19 Paul Thomas PR fortran/78990 diff --git a/gcc/testsuite/gcc.c-torture/compile/pr81360.c b/gcc/testsuite/gcc.c-torture/compile/pr81360.c new file mode 100644 index 00000000000..ffd3f2472de --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr81360.c @@ -0,0 +1,11 @@ +typedef a; +b(void *c, a d) { + if (c) + e(0, __PRETTY_FUNCTION__); +} +typedef f, g; +__attribute__((optimize(0))) h() { + g i; + b(i, sizeof(f)); +} + -- 2.30.2