Patchwork [tree-dump.c] : 7 of 7 Fix of PR target/53912 bootstrap fails using default c++ mode in stage 2 and 3 for native x86_64-w64-mingw32

login
register
mail settings
Submitter Kai Tietz
Date Nov. 29, 2012, 1:40 p.m.
Message ID <CAEwic4boW==_znCQEPk42JKLgTqJCiRRQY+Z=wAMRgdD=2p4TA@mail.gmail.com>
Download mbox | patch
Permalink /patch/202746/
State New
Headers show

Comments

Kai Tietz - Nov. 29, 2012, 1:40 p.m.
Updated variant using HOST_WIDE_INT_PRINT.

Tested for i686-w64-mingw32 and x86_64-w64-mingw32.  Ok for apply?

Kai
Kai Tietz - Dec. 2, 2012, 9:11 a.m.
Ping

2012/11/29 Kai Tietz <ktietz70@googlemail.com>:
> Updated variant using HOST_WIDE_INT_PRINT.
>
> Tested for i686-w64-mingw32 and x86_64-w64-mingw32.  Ok for apply?
>
> Kai
>
> Index: tree-dump.c
> ===================================================================
> --- tree-dump.c (Revision 193925)
> +++ tree-dump.c (Arbeitskopie)
> @@ -177,7 +177,8 @@ void
>  dump_pointer (dump_info_p di, const char *field, void *ptr)
>  {
>    dump_maybe_newline (di);
> -  fprintf (di->stream, "%-4s: %-8lx ", field, (unsigned long) ptr);
> +  fprintf (di->stream, "%-4s: %-8" HOST_WIDE_INT_PRINT "x ", field,
> +          (HOST_WIDE_INT) (uintptr_t) ptr);
>    di->column += 15;
>  }
Ian Taylor - Dec. 3, 2012, 3:49 a.m.
On Thu, Nov 29, 2012 at 5:40 AM, Kai Tietz <ktietz70@googlemail.com> wrote:
> Updated variant using HOST_WIDE_INT_PRINT.
>
> Tested for i686-w64-mingw32 and x86_64-w64-mingw32.  Ok for apply?
>
> Kai
>
> Index: tree-dump.c
> ===================================================================
> --- tree-dump.c (Revision 193925)
> +++ tree-dump.c (Arbeitskopie)
> @@ -177,7 +177,8 @@ void
>  dump_pointer (dump_info_p di, const char *field, void *ptr)
>  {
>    dump_maybe_newline (di);
> -  fprintf (di->stream, "%-4s: %-8lx ", field, (unsigned long) ptr);
> +  fprintf (di->stream, "%-4s: %-8" HOST_WIDE_INT_PRINT "x ", field,
> +          (HOST_WIDE_INT) (uintptr_t) ptr);
>    di->column += 15;
>  }

You should cast to (unsigned HOST_WIDE_INT), not (HOST_WIDE_INT).  The
%x printf conversion specifier expects an unsigned type.  This is OK
with that change and a ChangeLog entry.

Ian

Patch

Index: tree-dump.c
===================================================================
--- tree-dump.c (Revision 193925)
+++ tree-dump.c (Arbeitskopie)
@@ -177,7 +177,8 @@  void
 dump_pointer (dump_info_p di, const char *field, void *ptr)
 {
   dump_maybe_newline (di);
-  fprintf (di->stream, "%-4s: %-8lx ", field, (unsigned long) ptr);
+  fprintf (di->stream, "%-4s: %-8" HOST_WIDE_INT_PRINT "x ", field,
+          (HOST_WIDE_INT) (uintptr_t) ptr);
   di->column += 15;
 }