On 2008-02-14, Oleg Verych <[email protected]> wrote:
>>>> Are you saying tht the MSP430 backend gcc does not correctly
>>>> generate code to access misaligned struct members the way that
>>>> other backends (e.g. ARM) do?
>>>
>>> Based on what i've saw in this thread -- yes.
>>
>> If that's the case, it might need to be spelled out a little
>> more clearly in the manual.
>
>> It wasn't clear to me that the web page mentioned earlier was
>> saying that. That web page seemed to be talking about
>> peripheral registers.
>
> Any unaligned struct members *and* structures themselves on
> RISC generally, i guess. Better to ask developers. There is an
> alternative -- byte by byte access.
I don't understand. An "alternative" to what? It's what gcc
does on other targets when accessing misaligned packed struct
members.
> But how efficient it can be? Better to have good _design_
> right from the start.
If you don't get to define the layout of the data in memory, I
don't see how you can "design" your way around doing byte by
byte access of misaligned values.
--
Grant Edwards grante Yow! YOU'D cry too if it
at happened to YOU!!
visi.com