Patchwork [bootstrap] : Fix PR56227, bootstrap failure on MinGW.

login
register
mail settings
Submitter Uros Bizjak
Date Feb. 7, 2013, 12:18 p.m.
Message ID <CAFULd4ZORGyj5AVsC-1Hcwfb=kqn_S7XTmnq1DdOhxU8QCw4ew@mail.gmail.com>
Download mbox | patch
Permalink /patch/218906/
State New
Headers show

Comments

Uros Bizjak - Feb. 7, 2013, 12:18 p.m.
Hello!

Attached (trivial) patch substitutes a bunch of "ll" conversion types
with HOST_LONG_LONG_FORMAT defines. Additionally, it fixes wrong usage
of HOST_WIDE_INT_PRINT_HEX_PURE in the argument of internal_error.

The patch reportedly fixes bootstrap failures on i686-pc-mingw32.

2013-02-07  Uros Bizjak  <ubizjak@gmail.com>

	* ggc-page.c (ggc_print_statistics): Use HOST_LONG_LONG_FORMAT
	instead of "ll".
	* config/i386/i386.c (ix86_print_operand): Ditto.

lto/ChangeLog:

2013-02-07  Uros Bizjak  <ubizjak@gmail.com>

	* lto.c (lto_resolution_ready): Use %wx instead of
	HOST_WIDE_INT_PRINT_HEX_PURE in the argument to internal_error.

Bootstrapped on x86_64-pc-linux-gnu.

OK for mainline and 4.7 branch?

Uros.
Kai Tietz - Feb. 7, 2013, 3:40 p.m.
2013/2/7 Uros Bizjak <ubizjak@gmail.com>:
> Hello!
>
> Attached (trivial) patch substitutes a bunch of "ll" conversion types
> with HOST_LONG_LONG_FORMAT defines. Additionally, it fixes wrong usage
> of HOST_WIDE_INT_PRINT_HEX_PURE in the argument of internal_error.
>
> The patch reportedly fixes bootstrap failures on i686-pc-mingw32.
>
> 2013-02-07  Uros Bizjak  <ubizjak@gmail.com>
>
>         * ggc-page.c (ggc_print_statistics): Use HOST_LONG_LONG_FORMAT
>         instead of "ll".
>         * config/i386/i386.c (ix86_print_operand): Ditto.
>
> lto/ChangeLog:
>
> 2013-02-07  Uros Bizjak  <ubizjak@gmail.com>
>
>         * lto.c (lto_resolution_ready): Use %wx instead of
>         HOST_WIDE_INT_PRINT_HEX_PURE in the argument to internal_error.
>
> Bootstrapped on x86_64-pc-linux-gnu.
>
> OK for mainline and 4.7 branch?
>
> Uros.

I have no objections.

Thanks,
Kai

Patch

Index: lto/lto.c
===================================================================
--- lto/lto.c	(revision 195842)
+++ lto/lto.c	(working copy)
@@ -2225,8 +2225,7 @@  lto_resolution_read (splay_tree file_ids, FILE *re
 	{
 	  nd = lto_splay_tree_lookup (file_ids, id);
 	  if (nd == NULL)
-	    internal_error ("resolution sub id " HOST_WIDE_INT_PRINT_HEX_PURE
-			    " not in object file", id);
+	    internal_error ("resolution sub id %wx not in object file", id);
 	}
 
       file_data = (struct lto_file_decl_data *)nd->value;
Index: ggc-page.c
===================================================================
--- ggc-page.c	(revision 195842)
+++ ggc-page.c	(working copy)
@@ -2170,31 +2170,31 @@  ggc_print_statistics (void)
     {
       fprintf (stderr, "\nTotal allocations and overheads during the compilation process\n");
 
-      fprintf (stderr, "Total Overhead:                        %10lld\n",
+      fprintf (stderr, "Total Overhead:                        %10" HOST_LONG_LONG_FORMAT "d\n",
 	       G.stats.total_overhead);
-      fprintf (stderr, "Total Allocated:                       %10lld\n",
+      fprintf (stderr, "Total Allocated:                       %10" HOST_LONG_LONG_FORMAT "d\n",
 	       G.stats.total_allocated);
 
-      fprintf (stderr, "Total Overhead  under  32B:            %10lld\n",
+      fprintf (stderr, "Total Overhead  under  32B:            %10" HOST_LONG_LONG_FORMAT "d\n",
 	       G.stats.total_overhead_under32);
-      fprintf (stderr, "Total Allocated under  32B:            %10lld\n",
+      fprintf (stderr, "Total Allocated under  32B:            %10" HOST_LONG_LONG_FORMAT "d\n",
 	       G.stats.total_allocated_under32);
-      fprintf (stderr, "Total Overhead  under  64B:            %10lld\n",
+      fprintf (stderr, "Total Overhead  under  64B:            %10" HOST_LONG_LONG_FORMAT "d\n",
 	       G.stats.total_overhead_under64);
-      fprintf (stderr, "Total Allocated under  64B:            %10lld\n",
+      fprintf (stderr, "Total Allocated under  64B:            %10" HOST_LONG_LONG_FORMAT "d\n",
 	       G.stats.total_allocated_under64);
-      fprintf (stderr, "Total Overhead  under 128B:            %10lld\n",
+      fprintf (stderr, "Total Overhead  under 128B:            %10" HOST_LONG_LONG_FORMAT "d\n",
 	       G.stats.total_overhead_under128);
-      fprintf (stderr, "Total Allocated under 128B:            %10lld\n",
+      fprintf (stderr, "Total Allocated under 128B:            %10" HOST_LONG_LONG_FORMAT "d\n",
 	       G.stats.total_allocated_under128);
 
       for (i = 0; i < NUM_ORDERS; i++)
 	if (G.stats.total_allocated_per_order[i])
 	  {
-	    fprintf (stderr, "Total Overhead  page size %7lu:     %10lld\n",
+	    fprintf (stderr, "Total Overhead  page size %7lu:     %10" HOST_LONG_LONG_FORMAT "d\n",
 		     (unsigned long) OBJECT_SIZE (i),
 		     G.stats.total_overhead_per_order[i]);
-	    fprintf (stderr, "Total Allocated page size %7lu:     %10lld\n",
+	    fprintf (stderr, "Total Allocated page size %7lu:     %10" HOST_LONG_LONG_FORMAT "d\n",
 		     (unsigned long) OBJECT_SIZE (i),
 		     G.stats.total_allocated_per_order[i]);
 	  }
Index: config/i386/i386.c
===================================================================
--- config/i386/i386.c	(revision 195842)
+++ config/i386/i386.c	(working copy)
@@ -14628,7 +14628,8 @@  ix86_print_operand (FILE *file, rtx x, int code)
 	putc ('$', file);
       /* Sign extend 32bit SFmode immediate to 8 bytes.  */
       if (code == 'q')
-	fprintf (file, "0x%08llx", (unsigned long long) (int) l);
+	fprintf (file, "0x%08" HOST_LONG_LONG_FORMAT "x",
+		 (unsigned long long) (int) l);
       else
 	fprintf (file, "0x%08x", (unsigned int) l);
     }