diff options
author | Jan Hubicka <hubicka@ucw.cz> | 2015-01-13 21:59:37 +0100 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2015-01-13 20:59:37 +0000 |
commit | 2001028ad3a44e5333333c175118837dba03c620 (patch) | |
tree | 16b0e6a36e132f7bfcc281898adf43947cc7246d /gcc | |
parent | 59b8926c6fe2f4320babf3fd7e7d1ca8731e3890 (diff) | |
download | gcc-2001028ad3a44e5333333c175118837dba03c620.zip gcc-2001028ad3a44e5333333c175118837dba03c620.tar.gz gcc-2001028ad3a44e5333333c175118837dba03c620.tar.bz2 |
re PR ipa/64565 (ICE: in inline_small_functions, at ipa-inline.c:1664)
PR ipa/64565
* g++.dg/torture/pr64565.C: New testcase.
* ipa-inline.c (inline_small_functions): Update callee keys after
resolving speculation
(inline_small_functions): Always check monotonicity of the queue.
From-SVN: r219556
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/ipa-inline.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/torture/pr64565.C | 89 |
4 files changed, 104 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bdc3903..ef64307 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2015-01-13 Jan Hubicka <hubicka@ucw.cz> + + PR ipa/64565 + * ipa-inline.c (inline_small_functions): Update callee keys after + resolving speculation + (inline_small_functions): Always check monotonicity of the queue. + 2015-01-13 Marek Polacek <polacek@redhat.com> PR middle-end/64391 diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c index a99001ad..61e470f 100644 --- a/gcc/ipa-inline.c +++ b/gcc/ipa-inline.c @@ -1626,6 +1626,8 @@ inline_small_functions (void) reset_edge_caches (where); update_caller_keys (&edge_heap, where, updated_nodes, NULL); + update_callee_keys (&edge_heap, where, + updated_nodes); bitmap_clear (updated_nodes); } } @@ -1661,7 +1663,7 @@ inline_small_functions (void) /* Disable checking for profile because roundoff errors may cause slight deviations in the order. */ gcc_assert (max_count || cached_badness == current_badness); - gcc_assert (max_count || current_badness >= badness); + gcc_assert (current_badness >= badness); #else current_badness = edge_badness (edge, false); #endif diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a40d625..a0163c3 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-01-13 Jan Hubicka <hubicka@ucw.cz> + + PR ipa/64565 + * g++.dg/torture/pr64565.C: New testcase. + 2015-01-13 Marek Polacek <polacek@redhat.com> PR middle-end/64391 diff --git a/gcc/testsuite/g++.dg/torture/pr64565.C b/gcc/testsuite/g++.dg/torture/pr64565.C new file mode 100644 index 0000000..42b0239 --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr64565.C @@ -0,0 +1,89 @@ +/* { dg-do compile } */ +typedef enum +{ + NS_OK +} nsresult; +struct A +{ + static int kIID; +}; +class B +{ +}; +class C +{ +public: + C (B p1) { m_fn1 (p1, A::kIID); } + void m_fn1 (B, int); +}; +class D; +class F +{ +public: + F (int); +}; +class G +{ +public: + D *operator[](int); +}; +class H +{ + virtual nsresult m_fn2 (); + +public: + void m_fn3 (); +}; +class J : H +{ + G mQueries; + int mLiveUpdate; + nsresult m_fn2 (); +}; +class D +{ +public: + nsresult m_fn4 (int); + void m_fn5 (int); +}; +class I +{ +public: + static I * + m_fn6 () + { + B __trans_tmp_3; + if (!gHistoryService) + C serv = __trans_tmp_3; + } + void m_fn7 (); + static I *gHistoryService; +}; +D *Refresh___trans_tmp_2; +D Refresh___trans_tmp_6, Refresh___trans_tmp_5; +int Refresh_hasDomain; +nsresult +J::m_fn2 () +{ + m_fn3 (); + I history = *I::m_fn6 (); + switch (mLiveUpdate) + { + case 1: + { + mQueries[0]; + F query = 0; + if (Refresh_hasDomain) + return NS_OK; + } + case 0: + { + Refresh___trans_tmp_2 = mQueries[0]; + F query = Refresh___trans_tmp_5.m_fn4 (0); + history.m_fn7 (); + Refresh___trans_tmp_6.m_fn5 (0); + } + case 3: + m_fn2 (); + } +} |