diff options
author | Jan Hubicka <hubicka@ucw.cz> | 2015-02-05 01:16:11 +0100 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2015-02-05 00:16:11 +0000 |
commit | c1eed5a1541acfdfb1107a4400675c2407680ce8 (patch) | |
tree | 993d68912f49770cee8eaba7e7943a5872a7dbb5 /gcc | |
parent | 73d098df1f48db47e6fb2a840913fc05202378a0 (diff) | |
download | gcc-c1eed5a1541acfdfb1107a4400675c2407680ce8.zip gcc-c1eed5a1541acfdfb1107a4400675c2407680ce8.tar.gz gcc-c1eed5a1541acfdfb1107a4400675c2407680ce8.tar.bz2 |
re PR ipa/64686 (ICE: in edge_badness, at ipa-inline.c:912 during Firefox LTO build with enabled checking)
PR ipa/64686
* ipa-inline.c (inline_small_functions): Fix ordering issue between
speculation resolution and key updates.
* g++.dg/torture/pr64686.C: New testcase.
From-SVN: r220429
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/ipa-inline.c | 10 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/torture/pr64686.C | 19 |
4 files changed, 38 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f9726fc..fa6a7e8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 2015-02-04 Jan Hubicka <hubicka@ucw.cz> + PR ipa/64686 + * ipa-inline.c (inline_small_functions): Fix ordering issue between + speculation resolution and key updates. + +2015-02-04 Jan Hubicka <hubicka@ucw.cz> + * ipa-prop.c (update_indirect_edges_after_inlining): By more careful about not letting any speculative edges unupdated. diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c index d9ab56a..287a6dd 100644 --- a/gcc/ipa-inline.c +++ b/gcc/ipa-inline.c @@ -1702,6 +1702,7 @@ inline_small_functions (void) { bool update = false; struct cgraph_edge *next; + bool has_speculative = false; if (dump_file) fprintf (dump_file, "Enqueueing calls in %s/%i.\n", @@ -1719,12 +1720,17 @@ inline_small_functions (void) gcc_assert (!edge->aux); update_edge_key (&edge_heap, edge); } - if (edge->speculative && !speculation_useful_p (edge, edge->aux != NULL)) + if (edge->speculative) + has_speculative = true; + } + if (has_speculative) + for (edge = node->callees; edge; edge = next) + if (edge->speculative && !speculation_useful_p (edge, + edge->aux != NULL)) { edge->resolve_speculation (); update = true; } - } if (update) { struct cgraph_node *where = node->global.inlined_to diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ef62017..6ae0e63 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-02-04 Jan Hubicka <hubicka@ucw.cz> + + PR ipa/64686 + * g++.dg/torture/pr64686.C: New testcase. + 2015-02-04 H.J. Lu <hongjiu.lu@intel.com> PR rtl-optimization/64905 diff --git a/gcc/testsuite/g++.dg/torture/pr64686.C b/gcc/testsuite/g++.dg/torture/pr64686.C new file mode 100644 index 0000000..714aa41 --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr64686.C @@ -0,0 +1,19 @@ +// { dg-do compile } +class A +{ +protected: + A *m_fn2 (int) const; +public: + virtual A *m_fn1 (int *) const = 0; +}; +class B : A +{ + B (A *, int, A *); + A *m_fn1 (int *) const; +}; +A * +B::m_fn1 (int *) const +{ + new B (m_fn2 (0)->m_fn1 (0), 0, m_fn2 (0)->m_fn1 (0)); +} + |