From e3195c52b954dd2956385f6b209e2d51785d13a1 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Sat, 4 Jun 2011 16:24:20 +0200 Subject: [PATCH] re PR tree-optimization/48929 (ICE: in estimate_size_after_inlining, at ipa-inline-analysis.c:1961 with -findirect-inlining) PR tree-optimize/48929 * gcc.c-torture/compile/pr48929.c: New testcase. * ipa-inline-analysis.c (remap_edge_predicates): Fix handling of empty predicate. From-SVN: r174638 --- gcc/ChangeLog | 6 ++++ gcc/ipa-inline-analysis.c | 4 +++ gcc/testsuite/ChangeLog | 5 +++ gcc/testsuite/gcc.c-torture/compile/pr48929.c | 32 +++++++++++++++++++ 4 files changed, 47 insertions(+) create mode 100644 gcc/testsuite/gcc.c-torture/compile/pr48929.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c7f031f4ade..3306765661f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2011-06-04 Jan Hubicka + + PR tree-optimize/48929 + * ipa-inline-analysis.c (remap_edge_predicates): Fix handling + of empty predicate. + 2011-06-04 Alexandre Oliva PR debug/48333 diff --git a/gcc/ipa-inline-analysis.c b/gcc/ipa-inline-analysis.c index 4a65dd5be0f..45bfeb6f471 100644 --- a/gcc/ipa-inline-analysis.c +++ b/gcc/ipa-inline-analysis.c @@ -1949,6 +1949,8 @@ remap_edge_predicates (struct cgraph_node *node, if (!e->inline_failed) remap_edge_predicates (e->callee, info, callee_info, operand_map, possible_truths, toplev_predicate); + else + edge_set_predicate (e, toplev_predicate); } for (e = node->indirect_calls; e; e = e->next_callee) { @@ -1969,6 +1971,8 @@ remap_edge_predicates (struct cgraph_node *node, e->frequency = 0; } } + else + edge_set_predicate (e, toplev_predicate); } } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 6dd2803c754..05efca005b4 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-06-04 Jan Hubicka + + PR tree-optimize/48929 + * gcc.c-torture/compile/pr48929.c: New testcase. + 2011-06-04 Jakub Jelinek * gcc.dg/guality/rotatetest.c (f5, f6): Fix up pastos. diff --git a/gcc/testsuite/gcc.c-torture/compile/pr48929.c b/gcc/testsuite/gcc.c-torture/compile/pr48929.c new file mode 100644 index 00000000000..f085dc645ae --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr48929.c @@ -0,0 +1,32 @@ +/*{ dg-options "-O -findirect-inlining" }*/ +void bar (); + +static void +f4 (double di, double d, double *dd) +{ + if (d == 0 && di == 0) + *dd = 0; + bar (); +} + +static inline void +f3 (int i, double d) +{ + double di = i; + double dd; + f4 (di, d, &dd); +} + +static inline void +f2 (int i, double d) +{ + if (d < 0) + f3 (i, d); +} + +void +f1 () +{ + f2 (0, 1); +} + -- 2.30.2