diff options
author | Jan Hubicka <jh@suse.cz> | 2019-11-20 16:45:53 +0100 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2019-11-20 15:45:53 +0000 |
commit | 8e361de1b08a579fe5d771be5ba47cf31533380c (patch) | |
tree | 9104e297431a7f9bc64b9fcbcb4cd12a28a8896f | |
parent | 516fd7cedb025b09000563cdba6214461621400d (diff) |
Workaround bogus warning in fibonacci_heap<K,V>::consolidate.
* fibonacci_heap.h (fibonacci_heap<K,V>::consolidate): Turn auto_vec
to ordinary array.
From-SVN: r278504
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/fibonacci_heap.h | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6eb037f7d45..7ba36985c43 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2019-11-20 Jan Hubicka <jh@suse.cz> + * fibonacci_heap.h (fibonacci_heap<K,V>::consolidate): Turn auto_vec + to ordinary array. + +2019-11-20 Jan Hubicka <jh@suse.cz> + * fibonacci_heap.h (fibonacci_heap<K,V>::fibonacci_heap): Add allocator parameter. (fibonacci_heap<K,V>::~fibonacci_heap): Optimize destruction. diff --git a/gcc/fibonacci_heap.h b/gcc/fibonacci_heap.h index 9961648d505..ebd1a8bdafd 100644 --- a/gcc/fibonacci_heap.h +++ b/gcc/fibonacci_heap.h @@ -648,17 +648,18 @@ template<class K, class V> void fibonacci_heap<K,V>::consolidate () { const int D = 1 + 8 * sizeof (long); - auto_vec<fibonacci_node<K,V> *, D> a; + fibonacci_node<K,V> *a[D]; fibonacci_node<K,V> *w, *x, *y; int i, d; - a.quick_grow_cleared (D); + memset (a, 0, sizeof (a)); while ((w = m_root) != NULL) { x = w; remove_root (w); d = x->m_degree; + gcc_checking_assert (d < D); while (a[d] != NULL) { y = a[d]; |