Patchwork : 3 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, 12:07 p.m.
Message ID <CAEwic4bPe=spo0GKjr3qziouiB+deBC3xHUgPvV58==CiwEP1Q@mail.gmail.com>
Download mbox | patch
Permalink /patch/202724/
State New
Headers show

Comments

Kai Tietz - Nov. 29, 2012, 12:07 p.m.
Hello,

this trivial patch fixes a bootstrap issue on LLP64 hosts.

ChangeLog

2012-11-29 Kai Tietz

	PR target/53912
	* pointer-set.c (hash1): Cast from pointer via uintptr_t.

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

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

2012/11/29 Kai Tietz <ktietz70@googlemail.com>:
> Hello,
>
> this trivial patch fixes a bootstrap issue on LLP64 hosts.
>
> ChangeLog
>
> 2012-11-29 Kai Tietz
>
>         PR target/53912
>         * pointer-set.c (hash1): Cast from pointer via uintptr_t.
>
> Tested for i686-w64-mingw32, x86_64-w64-mingw32, and
> x86_64-unknown-gnu-linux. Ok for apply?
>
> Regards,
> Kai
>
> Index: pointer-set.c
> ===================================================================
> --- pointer-set.c       (Revision 193925)
> +++ pointer-set.c       (Arbeitskopie)
> @@ -64,7 +64,7 @@ hash1 (const void *p, unsigned long max, unsigned
>  #endif
>    const unsigned long shift = HOST_BITS_PER_LONG - logmax;
>
> -  return ((A * (unsigned long) p) >> shift) & (max - 1);
> +  return ((A * (uintptr_t) p) >> shift) & (max - 1);
>  }
>
>  /* Allocate an empty pointer set.  */
Ian Taylor - Dec. 3, 2012, 3:46 a.m.
On Thu, Nov 29, 2012 at 4:07 AM, Kai Tietz <ktietz70@googlemail.com> wrote:
>
> 2012-11-29 Kai Tietz
>
>         PR target/53912
>         * pointer-set.c (hash1): Cast from pointer via uintptr_t.

This is OK.

Thanks.

Ian

Patch

Index: pointer-set.c
===================================================================
--- pointer-set.c       (Revision 193925)
+++ pointer-set.c       (Arbeitskopie)
@@ -64,7 +64,7 @@  hash1 (const void *p, unsigned long max, unsigned
 #endif
   const unsigned long shift = HOST_BITS_PER_LONG - logmax;

-  return ((A * (unsigned long) p) >> shift) & (max - 1);
+  return ((A * (uintptr_t) p) >> shift) & (max - 1);
 }

 /* Allocate an empty pointer set.  */