Re: making sizeof(void*) different from sizeof(void(*)())

2012-05-23 Thread Georg-Johann Lay
Michael Meissner wrote: > On Sat, Apr 28, 2012 at 02:32:18PM -0500, Peter Bigot wrote: >> The MSP430's split address space and ISA make it expensive to place >> data above the 64 kB boundary, but cheap to place code there. So I'm >> looking for a way to use HImode for data pointers, but PSImode fo

Re: making sizeof(void*) different from sizeof(void(*)())

2012-05-17 Thread Michael Meissner
On Sat, Apr 28, 2012 at 02:32:18PM -0500, Peter Bigot wrote: > The MSP430's split address space and ISA make it expensive to place > data above the 64 kB boundary, but cheap to place code there. So I'm > looking for a way to use HImode for data pointers, but PSImode for > function pointers. If gc

Re: making sizeof(void*) different from sizeof(void(*)())

2012-05-02 Thread Peter Bigot
On Wed, May 2, 2012 at 8:08 AM, Paulo J. Matos wrote: > On 30/04/12 13:01, Peter Bigot wrote: >> >> I would like to see the technical details, if your code is released >> somewhere. >> > > Hi Peter, > > Sorry for the delay. > The code is not released, however I can send you a patch against GCC 4.6

Re: making sizeof(void*) different from sizeof(void(*)())

2012-05-02 Thread Paulo J. Matos
On 30/04/12 13:01, Peter Bigot wrote: I would like to see the technical details, if your code is released somewhere. Hi Peter, Sorry for the delay. The code is not released, however I can send you a patch against GCC 4.6.3 sources (our GCC 4.7.0 port is not yet stable) of our changes and wi

Re: making sizeof(void*) different from sizeof(void(*)())

2012-04-30 Thread Peter Bigot
On Mon, Apr 30, 2012 at 4:50 AM, Robert Dewar wrote: > On 4/30/2012 4:16 AM, Paulo J. Matos wrote: >> >> Peter, >> >> We have a working backend for an Harvard Architecture chip where >> function pointer and data pointers have necessarily different sizes. We >> couldn't do this without changing GCC

Re: making sizeof(void*) different from sizeof(void(*)())

2012-04-30 Thread Robert Dewar
On 4/30/2012 4:16 AM, Paulo J. Matos wrote: Peter, We have a working backend for an Harvard Architecture chip where function pointer and data pointers have necessarily different sizes. We couldn't do this without changing GCC itself in strategic places and adding some extra support in our backen

Re: making sizeof(void*) different from sizeof(void(*)())

2012-04-30 Thread Paulo J. Matos
Peter, We have a working backend for an Harvard Architecture chip where function pointer and data pointers have necessarily different sizes. We couldn't do this without changing GCC itself in strategic places and adding some extra support in our backend. We haven't used address spaces or any

Re: making sizeof(void*) different from sizeof(void(*)())

2012-04-29 Thread Andreas Schwab
Basile Starynkevitch writes: > `dlsym` is the obvious hint Most programs don't use dlsym. > also simply that most (probably nearly all) Linux/ELF systems and Unix > systems have same > size for data and function pointers. Those that don't use function descriptors. Andreas. -- Andreas Schwa

Re: making sizeof(void*) different from sizeof(void(*)())

2012-04-29 Thread Robert Dewar
On 4/29/2012 1:19 PM, Basile Starynkevitch wrote: For instance, I don't think that porting the Linux kernel (or the FreeBSD one) to such an architecture (having data pointers of different size that function pointers) is easy. Well it doesnt' surprise me too much that GNU/Linux has non-standa

Re: making sizeof(void*) different from sizeof(void(*)())

2012-04-29 Thread Basile Starynkevitch
On Sun, 29 Apr 2012 12:50:44 -0400 Robert Dewar wrote: > On 4/29/2012 12:47 PM, Basile Starynkevitch wrote: > > > My biased point of view is that designing a processor instruction set (for > > POSIX-like > > systems or standard C software in mind) with function pointers of different > > size t

Re: making sizeof(void*) different from sizeof(void(*)())

2012-04-29 Thread Robert Dewar
On 4/29/2012 12:47 PM, Basile Starynkevitch wrote: My biased point of view is that designing a processor instruction set (for POSIX-like systems or standard C software in mind) with function pointers of different size than data pointers is today a mistake: most software make the implicit assum

Re: making sizeof(void*) different from sizeof(void(*)())

2012-04-29 Thread Basile Starynkevitch
On Sun, 29 Apr 2012 09:43:02 -0400 Robert Dewar wrote: > On 4/29/2012 9:25 AM, Andreas Schwab wrote: > > Robert Dewar writes: > > > >> Just to be clear, there is nothing in the standard that forbids the > >> sizes being different AFAIK? I understand that both gcc and apps > >> may make unwarrant

Re: making sizeof(void*) different from sizeof(void(*)())

2012-04-29 Thread Georg-Johann Lay
Peter Bigot a écrit: Georg-Johann Lay wrote: Peter Bigot a écrit: The MSP430's split address space and ISA make it expensive to place data above the 64 kB boundary, but cheap to place code there. So I'm looking for a way to use HImode for data pointers, but PSImode for function pointers. I

Re: making sizeof(void*) different from sizeof(void(*)())

2012-04-29 Thread Robert Dewar
On 4/29/2012 9:25 AM, Andreas Schwab wrote: Robert Dewar writes: Just to be clear, there is nothing in the standard that forbids the sizes being different AFAIK? I understand that both gcc and apps may make unwarranted assumptions. POSIX makes that assumption, via the dlsym interface. that

Re: making sizeof(void*) different from sizeof(void(*)())

2012-04-29 Thread Andreas Schwab
Robert Dewar writes: > Just to be clear, there is nothing in the standard that forbids the > sizes being different AFAIK? I understand that both gcc and apps > may make unwarranted assumptions. POSIX makes that assumption, via the dlsym interface. Andreas. -- Andreas Schwab, sch...@linux-m68k

Re: making sizeof(void*) different from sizeof(void(*)())

2012-04-29 Thread Peter Bigot
On Sun, Apr 29, 2012 at 7:51 AM, Georg-Johann Lay wrote: > Peter Bigot a écrit: > >> The MSP430's split address space and ISA make it expensive to place >> data above the 64 kB boundary, but cheap to place code there.  So I'm >> looking for a way to use HImode for data pointers, but PSImode for >>

Re: making sizeof(void*) different from sizeof(void(*)())

2012-04-29 Thread Robert Dewar
On 4/29/2012 8:51 AM, Georg-Johann Lay wrote: Peter Bigot a écrit: The MSP430's split address space and ISA make it expensive to place data above the 64 kB boundary, but cheap to place code there. So I'm looking for a way to use HImode for data pointers, but PSImode for function pointers. If

Re: making sizeof(void*) different from sizeof(void(*)())

2012-04-29 Thread Georg-Johann Lay
Peter Bigot a écrit: The MSP430's split address space and ISA make it expensive to place data above the 64 kB boundary, but cheap to place code there. So I'm looking for a way to use HImode for data pointers, but PSImode for function pointers. If gcc supports this, it's not obvious how. I get

making sizeof(void*) different from sizeof(void(*)())

2012-04-28 Thread Peter Bigot
The MSP430's split address space and ISA make it expensive to place data above the 64 kB boundary, but cheap to place code there. So I'm looking for a way to use HImode for data pointers, but PSImode for function pointers. If gcc supports this, it's not obvious how. I get partway there with FUNC