Patchwork : Fix for PR 55707 bootstrap fails in gcc/graphite-dependences.c error cast loses precision

login
register
mail settings
Submitter Rainer Emrich
Date Jan. 3, 2013, 12:08 p.m.
Message ID <50E574D2.2000906@emrich-ebersheim.de>
Download mbox | patch
Permalink /patch/209228/
State New
Headers show

Comments

Rainer Emrich - Jan. 3, 2013, 12:08 p.m.
Hello,

this trivial patch fixes a bootstrap issue on LLP64 hosts.

	PR 55707
	* graphite-dependences.c (hash_poly_ddr_p): Cast from pointer via
	intptr_t.

Tested for x86_64-w64-mingw32 and x86_64-unknown-gnu-linux.

If OK for apply, Kai please commit.

Regards,

Rainer
Richard Guenther - Jan. 3, 2013, 12:14 p.m.
On Thu, Jan 3, 2013 at 1:08 PM, Rainer Emrich
<rainer@emrich-ebersheim.de> wrote:
> Hello,
>
> this trivial patch fixes a bootstrap issue on LLP64 hosts.
>
>         PR 55707
>         * graphite-dependences.c (hash_poly_ddr_p): Cast from pointer via
>         intptr_t.
>
> Tested for x86_64-w64-mingw32 and x86_64-unknown-gnu-linux.
>
> If OK for apply, Kai please commit.

Ok.

Thanks,
Richard.

> Regards,
>
> Rainer
>
> Index: graphite-dependences.c
> ===================================================================
> --- graphite-dependences.c      (Revision 194638)
> +++ graphite-dependences.c      (Arbeitskopie)
> @@ -56,7 +56,7 @@ hash_poly_ddr_p (const void *pddr)
>  {
>    const struct poly_ddr *p = (const struct poly_ddr *) pddr;
>
> -  return (hashval_t) ((long) PDDR_SOURCE (p) + (long) PDDR_SINK (p));
> +  return (hashval_t) ((intptr_t) PDDR_SOURCE (p) + (intptr_t) PDDR_SINK (p));
>  }
>
>  /* Returns true when PDDR has no dependence.  */
Kai Tietz - Jan. 3, 2013, 4:49 p.m.
Hi Rainer,

applied at rev 194859.

Thanks,
Kai

Patch

Index: graphite-dependences.c
===================================================================
--- graphite-dependences.c      (Revision 194638)
+++ graphite-dependences.c      (Arbeitskopie)
@@ -56,7 +56,7 @@  hash_poly_ddr_p (const void *pddr)
 {
   const struct poly_ddr *p = (const struct poly_ddr *) pddr;

-  return (hashval_t) ((long) PDDR_SOURCE (p) + (long) PDDR_SINK (p));
+  return (hashval_t) ((intptr_t) PDDR_SOURCE (p) + (intptr_t) PDDR_SINK (p));
 }

 /* Returns true when PDDR has no dependence.  */