RE: cast to pointer from integer of different size

2006-09-22 Thread Dave Korn
On 22 September 2006 17:45, Paul Brook wrote: > On Friday 22 September 2006 16:56, Dave Korn wrote: >> On 22 September 2006 16:01, Ian Lance Taylor wrote: >>> [EMAIL PROTECTED] (Jack Howarth) writes: Looking at the libffi/src/powerpc/ffi.c file, I assume that I should have the same..

Re: cast to pointer from integer of different size

2006-09-22 Thread Paul Brook
On Friday 22 September 2006 16:56, Dave Korn wrote: > On 22 September 2006 16:01, Ian Lance Taylor wrote: > > [EMAIL PROTECTED] (Jack Howarth) writes: > >> Looking at the libffi/src/powerpc/ffi.c file, I assume that I should > >> have the same... > >> > >>*next_arg++ = (unsigned long)(char

RE: cast to pointer from integer of different size

2006-09-22 Thread Dave Korn
On 22 September 2006 16:01, Ian Lance Taylor wrote: > [EMAIL PROTECTED] (Jack Howarth) writes: > >> Looking at the libffi/src/powerpc/ffi.c file, I assume that I should >> have the same... >> >>*next_arg++ = (unsigned long)(char *)ecif->rvalue; > > Sure looks like you want uintptr_t th

Re: cast to pointer from integer of different size

2006-09-22 Thread Ian Lance Taylor
[EMAIL PROTECTED] (Jack Howarth) writes: > Looking at the libffi/src/powerpc/ffi.c file, I assume that > I should have the same... > >*next_arg++ = (unsigned long)(char *)ecif->rvalue; Sure looks like you want uintptr_t there. I think using "unsigned long" is just setting yourself up fo

Re: cast to pointer from integer of different size

2006-09-22 Thread Peter Bergner
On Fri, 2006-09-22 at 08:53 -0500, Peter Bergner wrote: > On Fri, 2006-09-22 at 09:33 -0400, Jack Howarth wrote: > > Peter, > > Looking at the libffi/src/powerpc/ffi.c file, I assume that > > I should have the same... > > > >*next_arg++ = (unsigned long)(char *)ecif->rvalue; > > > > in ff

Re: cast to pointer from integer of different size

2006-09-22 Thread Jack Howarth
Peter, I should have added that when I last tested libffi at -m64 on Darwin PPC and saw roughly half of the tests fail... http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29152 ...it seemed that the failures were all in the dg-output tests. Hopefully this fix will have some positive results in the

Re: cast to pointer from integer of different size

2006-09-22 Thread Jack Howarth
Peter, Okay so what we need is... Index: ffi_darwin.c === --- ffi_darwin.c(revision 117142) +++ ffi_darwin.c(working copy) @@ -94,7 +94,7 @@ /* 'next_arg' grows up as we put parameters in it. */ - unsigned

Re: cast to pointer from integer of different size

2006-09-22 Thread Peter Bergner
On Fri, 2006-09-22 at 09:33 -0400, Jack Howarth wrote: > Peter, > Looking at the libffi/src/powerpc/ffi.c file, I assume that > I should have the same... > >*next_arg++ = (unsigned long)(char *)ecif->rvalue; > > in ffi_darwin.c instead of the current... > >*next_arg++ = (unsigned)(ch

Re: cast to pointer from integer of different size

2006-09-22 Thread Jack Howarth
Peter, Looking at the libffi/src/powerpc/ffi.c file, I assume that I should have the same... *next_arg++ = (unsigned long)(char *)ecif->rvalue; in ffi_darwin.c instead of the current... *next_arg++ = (unsigned)(char *)ecif->rvalue; Does that sound right? If so, I'll file a PR for this

Re: cast to pointer from integer of different size

2006-09-21 Thread Magnus Fromreide
On tor, 2006-09-21 at 23:10 -0500, Peter Bergner wrote: > On Thu, 2006-09-21 at 23:54 -0400, Jack Howarth wrote: > > Peter, > > Wouldn't we want something like... > > > > > +#ifdef __powerpc64__ > > +unsigned long FindTopOfStack(unsigned long stack_start) { > > +#else > > unsigned long FindT

Re: cast to pointer from integer of different size

2006-09-21 Thread Peter Bergner
On Thu, 2006-09-21 at 23:54 -0400, Jack Howarth wrote: > We have > the same issue in gcc-4.2-20060915/libffi/src/powerpc/ffi_darwin.c > (which might explain why it fails so many tests at -m64). > > http://gcc.gnu.org/ml/gcc/2006-09/msg00277.html For this thread, you have: *next_arg++ = (uns

Re: cast to pointer from integer of different size

2006-09-21 Thread Peter Bergner
On Thu, 2006-09-21 at 23:54 -0400, Jack Howarth wrote: > Peter, > Wouldn't we want something like... > > +#ifdef __powerpc64__ > +unsigned long FindTopOfStack(unsigned long stack_start) { > +#else > unsigned long FindTopOfStack(unsigned int stack_start) { > +#endif Why have the #ifdef? Why

Re: cast to pointer from integer of different size

2006-09-21 Thread Jack Howarth
Peter, Wouldn't we want something like... Index: darwin_stop_world.c === --- darwin_stop_world.c (revision 117133) +++ darwin_stop_world.c (working copy) @@ -61,7 +61,11 @@ typedef struct StackFrame { unsigned longsaved

RE: cast to pointer from integer of different size

2006-09-21 Thread Dave Korn
On 22 September 2006 04:06, Jack Howarth wrote: > I've been trying to get a handle on why the line... > > frame = (StackFrame *)stack_start; > > in gcc/boehm-gc/darwin_stop_world.c only generates the warning... > > ../../../../gcc-4.2-20060920/boehm-gc/darwin_stop_world.c:76: warning: c

Re: cast to pointer from integer of different size

2006-09-21 Thread Peter Bergner
On Thu, 2006-09-21 at 23:06 -0400, Jack Howarth wrote: > Andrew, > I've been trying to get a handle on why the line... > > frame = (StackFrame *)stack_start; > > in gcc/boehm-gc/darwin_stop_world.c only generates the warning... > > ../../../../gcc-4.2-20060920/boehm-gc/darwin_stop_world.