From: Jan Hubicka Date: Wed, 17 Jan 2018 20:40:46 +0000 (+0100) Subject: re PR ipa/83051 (ICE on valid code at -O3: in edge_badness, at ipa-inline.c:1024) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a99670f923dec07fe1b2813419f33e0cd18e091e;p=gcc.git re PR ipa/83051 (ICE on valid code at -O3: in edge_badness, at ipa-inline.c:1024) PR ipa/83051 * ipa-inline.c (flatten_function): Do not overwrite final inlining failure. * gcc.c-torture/compile/pr83051-2.c: New testcase. From-SVN: r256818 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6f30d4cab02..6091649b65d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-01-17 Jan Hubicka + + PR ipa/83051 + * ipa-inline.c (flatten_function): Do not overwrite final inlining + failure. + 2018-01-17 Will Schmidt * config/rs6000/rs6000.c (rs6000_gimple_builtin): Add gimple folding diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c index 145ffbb5ef0..4a7181e76a5 100644 --- a/gcc/ipa-inline.c +++ b/gcc/ipa-inline.c @@ -2083,7 +2083,8 @@ flatten_function (struct cgraph_node *node, bool early) "Not inlining %s into %s to avoid cycle.\n", xstrdup_for_dump (callee->name ()), xstrdup_for_dump (e->caller->name ())); - e->inline_failed = CIF_RECURSIVE_INLINING; + if (cgraph_inline_failed_type (e->inline_failed) != CIF_FINAL_ERROR) + e->inline_failed = CIF_RECURSIVE_INLINING; continue; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a1ebfc36c27..fb0e919913f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-01-17 Jan Hubicka + + PR ipa/83051 + * gcc.c-torture/compile/pr83051-2.c: New testcase. + 2018-01-17 Paolo Carlini PR c++/81054 diff --git a/gcc/testsuite/gcc.c-torture/compile/pr83051-2.c b/gcc/testsuite/gcc.c-torture/compile/pr83051-2.c new file mode 100644 index 00000000000..2bb2eaff54f --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr83051-2.c @@ -0,0 +1,12 @@ +/* { dg-options "-fno-early-inlining" } */ +void +bar () +{ + bar (0); +} + +__attribute__ ((flatten)) +void foo () +{ + bar (); +}