Re: IPA ICF fallout: i586 bootstrap failure fix
On 10/16/2014 02:45 PM, Jakub Jelinek wrote: On Thu, Oct 16, 2014 at 02:41:36PM +0200, Martin Liška wrote: Hello. Following patch fixes i586 bootstrap failure: https://gcc.gnu.org/ml/gcc-testresults/2014-10/msg01713.html ../../src-trunk/gcc/ipa-icf.c:2096:23: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘std::list::size_type {aka unsigned int}’ [-Werror=format=] worklist.size ()); ^ ../../src-trunk/gcc/ipa-icf.c: In member function ‘void ipa_icf::sem_item_optimizer::dump_cong_classes()’: ../../src-trunk/gcc/ipa-icf.c:2116:61: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘size_t {aka unsigned int}’ [-Werror=format=] m_classes_count, m_classes.elements(), m_items.length ()); Ready for thunk? Thank you, Martin gcc/ChangeLog: 2014-10-16 Martin Liska * ipa-icf.c (sem_item_optimizer::process_cong_reduction): size_t cast added. Too long line, please wrap. I'd write "Cast to unsigned long." instead. Thank you for note, applied as suggested. Martin (sem_item_optimizer::dump_cong_classes): Likewise. Ok. Jakub
Re: IPA ICF fallout: i586 bootstrap failure fix
On Thu, Oct 16, 2014 at 02:41:36PM +0200, Martin Liška wrote: > Hello. > > Following patch fixes i586 bootstrap failure: > https://gcc.gnu.org/ml/gcc-testresults/2014-10/msg01713.html > > ../../src-trunk/gcc/ipa-icf.c:2096:23: error: format ‘%lu’ expects argument > of type ‘long unsigned int’, but argument 3 has type > ‘std::list::size_type {aka unsigned int}’ > [-Werror=format=] >worklist.size ()); >^ > ../../src-trunk/gcc/ipa-icf.c: In member function ‘void > ipa_icf::sem_item_optimizer::dump_cong_classes()’: > ../../src-trunk/gcc/ipa-icf.c:2116:61: error: format ‘%lu’ expects argument > of type ‘long unsigned int’, but argument 4 has type ‘size_t {aka unsigned > int}’ [-Werror=format=] > m_classes_count, m_classes.elements(), m_items.length ()); > > Ready for thunk? > > Thank you, > Martin > gcc/ChangeLog: > > 2014-10-16 Martin Liska > > * ipa-icf.c (sem_item_optimizer::process_cong_reduction): size_t cast > added. Too long line, please wrap. I'd write "Cast to unsigned long." instead. > (sem_item_optimizer::dump_cong_classes): Likewise. Ok. Jakub
Re: IPA ICF fallout: i586 bootstrap failure fix
> Hello. > > Following patch fixes i586 bootstrap failure: > https://gcc.gnu.org/ml/gcc-testresults/2014-10/msg01713.html > > ../../src-trunk/gcc/ipa-icf.c:2096:23: error: format ‘%lu’ expects argument > of type ‘long unsigned int’, but argument 3 has type > ‘std::list::size_type {aka unsigned int}’ > [-Werror=format=] >worklist.size ()); >^ > ../../src-trunk/gcc/ipa-icf.c: In member function ‘void > ipa_icf::sem_item_optimizer::dump_cong_classes()’: > ../../src-trunk/gcc/ipa-icf.c:2116:61: error: format ‘%lu’ expects argument > of type ‘long unsigned int’, but argument 4 has type ‘size_t {aka unsigned > int}’ [-Werror=format=] > m_classes_count, m_classes.elements(), m_items.length ()); > > Ready for thunk? > OK, (I would consider this obvious) Honza > Thank you, > Martin > gcc/ChangeLog: > > 2014-10-16 Martin Liska > > * ipa-icf.c (sem_item_optimizer::process_cong_reduction): size_t cast > added. > (sem_item_optimizer::dump_cong_classes): Likewise. > diff --git a/gcc/ipa-icf.c b/gcc/ipa-icf.c > index 4e73849..f7510b3 100644 > --- a/gcc/ipa-icf.c > +++ b/gcc/ipa-icf.c > @@ -2093,7 +2093,7 @@ sem_item_optimizer::process_cong_reduction (void) > >if (dump_file) > fprintf (dump_file, "Worklist has been filled with: %lu\n", > - worklist.size ()); > + (unsigned long) worklist.size ()); > >if (dump_file && (dump_flags & TDF_DETAILS)) > fprintf (dump_file, "Congruence class reduction\n"); > @@ -2113,7 +2113,7 @@ sem_item_optimizer::dump_cong_classes (void) > >fprintf (dump_file, > "Congruence classes: %u (unique hash values: %lu), with total: %u > items\n", > -m_classes_count, m_classes.elements(), m_items.length ()); > +m_classes_count, (unsigned long) m_classes.elements(), > m_items.length ()); > >/* Histogram calculation. */ >unsigned int max_index = 0;