Patchwork {patch ira-color.c]: Fix printf-formatter use for long-long type for windows native targets.

login
register
mail settings
Submitter Kai Tietz
Date Dec. 9, 2011, 11 a.m.
Message ID <CAEwic4ap2yqpwKwpHw1RjuAjGoPhgUc-kCL7FfgVU68edseW0Q@mail.gmail.com>
Download mbox | patch
Permalink /patch/130338/
State New
Headers show

Comments

Kai Tietz - Dec. 9, 2011, 11 a.m.
So this patch replace use of 'long long' in ira-color.c and in
ira-conflict.c by HOST_WIDEST_INT.

Kai

ChangeLog

2011-12-09  Kai Tietz  <ktietz@redhat.com>

	* ira-color.c (print_hard_regs_subforest): Use
	HOST_WIDEST_INT_PRINT_DEC instead of %lld.
	(allocno_hard_regs): Change type of cost member
	to HOST_WIDEST_INT.
	(add_allocno_hard_regs): Change type of argument cost
	to HOST_WIDEST_INT.
	* ira-conflict.c (build_conflict_bit_table): Replace use
	of long-long by HOST_WIDEST_INT.

Tested for i686-w64-mingw32, x86_64-w64-mingw32, and
x86_64-unknown-linux-gnu.  Ok for apply?

Kai
Richard Guenther - Dec. 9, 2011, 11:30 a.m.
On Fri, Dec 9, 2011 at 12:00 PM, Kai Tietz <ktietz70@googlemail.com> wrote:
> So this patch replace use of 'long long' in ira-color.c and in
> ira-conflict.c by HOST_WIDEST_INT.

Ok.

Thanks,
Richard.

> Kai
>
> ChangeLog
>
> 2011-12-09  Kai Tietz  <ktietz@redhat.com>
>
>        * ira-color.c (print_hard_regs_subforest): Use
>        HOST_WIDEST_INT_PRINT_DEC instead of %lld.
>        (allocno_hard_regs): Change type of cost member
>        to HOST_WIDEST_INT.
>        (add_allocno_hard_regs): Change type of argument cost
>        to HOST_WIDEST_INT.
>        * ira-conflict.c (build_conflict_bit_table): Replace use
>        of long-long by HOST_WIDEST_INT.
>
> Tested for i686-w64-mingw32, x86_64-w64-mingw32, and
> x86_64-unknown-linux-gnu.  Ok for apply?
>
> Kai
>
> Index: ira-color.c
> ===================================================================
> --- ira-color.c (revision 182092)
> +++ ira-color.c (working copy)
> @@ -53,7 +53,7 @@
>   HARD_REG_SET set;
>   /* Overall (spilling) cost of all allocnos with given register
>      set.  */
> -  long long int cost;
> +  HOST_WIDEST_INT cost;
>  };
>
>  typedef struct allocno_hard_regs_node *allocno_hard_regs_node_t;
> @@ -229,7 +229,7 @@
>  /* Add (or update info about) allocno hard registers with SET and
>    COST.  */
>  static allocno_hard_regs_t
> -add_allocno_hard_regs (HARD_REG_SET set, long long int cost)
> +add_allocno_hard_regs (HARD_REG_SET set, HOST_WIDEST_INT cost)
>  {
>   struct allocno_hard_regs temp;
>   allocno_hard_regs_t hv;
> @@ -498,7 +498,7 @@
>        fprintf (f, " ");
>       fprintf (f, "%d:(", node->preorder_num);
>       print_hard_reg_set (f, node->hard_regs->set, false);
> -      fprintf (f, ")@%lld\n", node->hard_regs->cost);
> +      fprintf (f, ")@" HOST_WIDEST_INT_PRINT_DEC "\n", node->hard_regs->cost);
>       print_hard_regs_subforest (f, node->first, level + 1);
>     }
>  }
> Index: ira-conflicts.c
> ===================================================================
> --- ira-conflicts.c     (revision 182092)
> +++ ira-conflicts.c     (working copy)
> @@ -116,8 +116,8 @@
>          = ((OBJECT_MAX (obj) - OBJECT_MIN (obj) + IRA_INT_BITS)
>             / IRA_INT_BITS);
>        allocated_words_num += conflict_bit_vec_words_num;
> -       if ((unsigned long long) allocated_words_num * sizeof (IRA_INT_TYPE)
> -           > (unsigned long long) IRA_MAX_CONFLICT_TABLE_SIZE * 1024 * 1024)
> +       if ((unsigned HOST_WIDEST_INT) allocated_words_num * sizeof (IRA_INT_TYPE)
> +           > (unsigned HOST_WIDEST_INT) IRA_MAX_CONFLICT_TABLE_SIZE * 1024 * 1024)
>          {
>            if (internal_flag_ira_verbose > 0 && ira_dump_file != NULL)
>              fprintf

Patch

Index: ira-color.c
===================================================================
--- ira-color.c	(revision 182092)
+++ ira-color.c	(working copy)
@@ -53,7 +53,7 @@ 
   HARD_REG_SET set;
   /* Overall (spilling) cost of all allocnos with given register
      set.  */
-  long long int cost;
+  HOST_WIDEST_INT cost;
 };

 typedef struct allocno_hard_regs_node *allocno_hard_regs_node_t;
@@ -229,7 +229,7 @@ 
 /* Add (or update info about) allocno hard registers with SET and
    COST.  */
 static allocno_hard_regs_t
-add_allocno_hard_regs (HARD_REG_SET set, long long int cost)
+add_allocno_hard_regs (HARD_REG_SET set, HOST_WIDEST_INT cost)
 {
   struct allocno_hard_regs temp;
   allocno_hard_regs_t hv;
@@ -498,7 +498,7 @@ 
 	fprintf (f, " ");
       fprintf (f, "%d:(", node->preorder_num);
       print_hard_reg_set (f, node->hard_regs->set, false);
-      fprintf (f, ")@%lld\n", node->hard_regs->cost);
+      fprintf (f, ")@" HOST_WIDEST_INT_PRINT_DEC "\n", node->hard_regs->cost);
       print_hard_regs_subforest (f, node->first, level + 1);
     }
 }
Index: ira-conflicts.c
===================================================================
--- ira-conflicts.c	(revision 182092)
+++ ira-conflicts.c	(working copy)
@@ -116,8 +116,8 @@ 
 	  = ((OBJECT_MAX (obj) - OBJECT_MIN (obj) + IRA_INT_BITS)
 	     / IRA_INT_BITS);
 	allocated_words_num += conflict_bit_vec_words_num;
-	if ((unsigned long long) allocated_words_num * sizeof (IRA_INT_TYPE)
-	    > (unsigned long long) IRA_MAX_CONFLICT_TABLE_SIZE * 1024 * 1024)
+	if ((unsigned HOST_WIDEST_INT) allocated_words_num * sizeof (IRA_INT_TYPE)
+	    > (unsigned HOST_WIDEST_INT) IRA_MAX_CONFLICT_TABLE_SIZE * 1024 * 1024)
 	  {
 	    if (internal_flag_ira_verbose > 0 && ira_dump_file != NULL)
 	      fprintf