[PATCH, i386]: Fix PR target/34856: ICE with some constant vectors
Uros Bizjak
ubizjak@gmail.com
Fri Jan 25 12:08:00 GMT 2008
On Jan 25, 2008 2:34 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> Hi Uros,
>
> On Linux/Intel64, I got
> [hjl@gnu-26 gcc]$ /export/build/gnu/gcc/build-x86_64-linux/gcc/xgcc
> -B/export/build/gnu/gcc/build-x86_64-linux/gcc/
> /net/gnu-13/export/gnu/src/gcc/gcc/gcc/testsuite/gcc.dg/pr34856.c
> -O2 -msse2 -fno-show-column -S -o pr34856.s
> /net/gnu-13/export/gnu/src/gcc/gcc/gcc/testsuite/gcc.dg/pr34856.c: In
> function 'f1':
> /net/gnu-13/export/gnu/src/gcc/gcc/gcc/testsuite/gcc.dg/pr34856.c:18:
> warning: cast from pointer to integer of different size
We need uintptr_t to properly cast pointer. Attached patch fixes this.
2008-01-25 Uros Bizjak <ubizjak@gmail.com>
PR target/34856
* gcc.dg/pr34856.c: Include stdint.h. Use uintptr_t to
cast pointer to g[].
Uros.
Index: pr34856.c
===================================================================
--- pr34856.c (revision 131816)
+++ pr34856.c (working copy)
@@ -2,8 +2,10 @@
/* { dg-options "-O2" } */
/* { dg-options "-O2 -msse2" { target { i?86-*-* x86_64-*-* } } } */
+#include <stdint.h>
+
#undef __vector
-#define __vector __attribute__((vector_size(16) ))
+#define __vector __attribute__ ((__vector_size__ (16)))
typedef __vector signed char qword;
typedef __vector unsigned int VU32;
@@ -15,7 +17,8 @@
void f1 (unsigned ctr)
{
VU32 pin;
- pin = (VU32){(unsigned int) &g[16]};
+
+ pin = (VU32){(uintptr_t) &g[16]};
do
{
f ((qword) pin);
More information about the Gcc-patches
mailing list