diff mbox

IPA ICF fallout: i586 bootstrap failure fix

Message ID 543FBD00.1040708@suse.cz
State New
Headers show

Commit Message

Martin Liška Oct. 16, 2014, 12:41 p.m. UTC
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<ipa_icf::congruence_class*>::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  <mliska@suse.cz>

	* ipa-icf.c (sem_item_optimizer::process_cong_reduction): size_t cast added.
	(sem_item_optimizer::dump_cong_classes): Likewise.

Comments

Jan Hubicka Oct. 16, 2014, 12:45 p.m. UTC | #1
> 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<ipa_icf::congruence_class*>::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  <mliska@suse.cz>
> 
> 	* 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;
Jakub Jelinek Oct. 16, 2014, 12:45 p.m. UTC | #2
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<ipa_icf::congruence_class*>::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  <mliska@suse.cz>
> 
>	* 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
Martin Liška Oct. 16, 2014, 12:48 p.m. UTC | #3
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<ipa_icf::congruence_class*>::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  <mliska@suse.cz>
>>
>> 	* 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
>
diff mbox

Patch

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;