Hello,

this trivial patch fixes a bootstrap issue on LLP64 hosts.

        cp/
        
        PR target/53912
        * class.c (dump_class_hierarchy_r): Cast from pointer via uintptr_t.
        (dump_vtable): Likewise.

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

Regards,
Kai

Index: cp/class.c
===================================================================
--- cp/class.c  (Revision 193925)
+++ cp/class.c  (Arbeitskopie)
@@ -7817,7 +7817,7 @@ dump_class_hierarchy_r (FILE *stream,
   indented = maybe_indent_hierarchy (stream, indent, 0);
   fprintf (stream, "%s (0x%lx) ",
           type_as_string (BINFO_TYPE (binfo), TFF_PLAIN_IDENTIFIER),
-          (unsigned long) binfo);
+          (unsigned long) (uintptr_t) binfo);
   if (binfo != igo)
     {
       fprintf (stream, "alternative-path\n");
@@ -7842,7 +7842,7 @@ dump_class_hierarchy_r (FILE *stream,
       fprintf (stream, " primary-for %s (0x%lx)",
               type_as_string (BINFO_TYPE (BINFO_INHERITANCE_CHAIN (binfo)),
                               TFF_PLAIN_IDENTIFIER),
-              (unsigned long)BINFO_INHERITANCE_CHAIN (binfo));
+              (unsigned long) (uintptr_t) BINFO_INHERITANCE_CHAIN (binfo));
     }
   if (BINFO_LOST_PRIMARY_P (binfo))
     {
@@ -7975,7 +7975,8 @@ dump_vtable (tree t, tree binfo, tree vtable)
       if (ctor_vtbl_p)
        {
          if (!BINFO_VIRTUAL_P (binfo))
-           fprintf (stream, " (0x%lx instance)", (unsigned long)binfo);
+           fprintf (stream, " (0x%lx instance)", (unsigned long)
+                    (uintptr_t) binfo);
          fprintf (stream, " in %s", type_as_string (t, TFF_PLAIN_IDENTIFIER));
        }
       fprintf (stream, "\n");

Reply via email to