This is the mail archive of the ecos-discuss@sourceware.cygnus.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: How to create a new platform?


Grant Edwards wrote:
> Jifl wrote:
> > If this is actually a define, ie. #define UARTBASE ((UartType *)0x3604000)
> > then it would be very bad if gcc could not optimize "UARTBASE->foo" to be a
> > direct access to a single memory address, rather than having to do the
> > addition.
> 
> Most compilers will do that (and I'm pretty sure gcc does).
> But since the ARM can't directly access memory in a general
> way, the code generated ends up being pointer operations
> anyway, so for me I think it turns out to be a moot point.

But surely this is no worse than specifying it in a linker script? i.e. when
you said:

>For most of the processors I've used in the past, the pointer
>dereferencing generates larger code.  [Once you've spend a
>couple weeks trying to trim a couple hundred bytes from a
>binary, you have a hard time breaking the habit of not using
>memory that you don't have to.] 

Jifl
-- 
Red Hat, 35 Cambridge Place, Cambridge, UK. CB2 1NS  Tel: +44 (1223) 728762
"Plan to be spontaneous tomorrow."  ||  These opinions are all my own fault

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]