[coldfire-gnu-discuss] Coldfire Toolchain packed structure bug version 4.1.30 and newer
Carlos O'Donell
carlos at codesourcery.com
Wed Apr 18 22:16:26 UTC 2007
On Wed, Apr 18, 2007 at 05:30:56PM -0400, Malnar, Tom wrote:
> Thank Carlos, I really appreciate the quick follow up.
>
> I just wanted to mention (may help your investigation) that there may be
> two issues.
>
> The assembly actually produced when the alignment was 1 is very bad.
> I assume when alignment was 1 that my 'short' variable was treated as
> two bytes. To move two bytes, something like:
>
> moveal %fp@(-4),%a0
> clrl %d0
> moveb %d0,%a0@
> mov3ql #2,%d0
> moveb %d0,%a0@(1)
>
> would do the job. The code it produced was:
>
> 12: 206e fffc moveal %fp@(-4),%a0
> 16: 1010 moveb %a0@,%d0
> 18: 4281 clrl %d1
> 1a: c081 andl %d1,%d0
> 1c: 1000 moveb %d0,%d0
> 1e: 1080 moveb %d0,%a0@
> 20: 1028 0001 moveb %a0@(1),%d0
> 24: 4281 clrl %d1
> 26: c081 andl %d1,%d0
> 28: 1000 moveb %d0,%d0
> 2a: a541 mov3ql #2,%d1
> 2c: 8081 orl %d1,%d0
> 2e: 1000 moveb %d0,%d0
> 30: 1140 0001 moveb %d0,%a0@(1)
>
> Not sure if the issues are related or not, but it should probably be
> investigated.
You need to turn on the compiler optimizations with "-O1" or higher if
you want optimized code.
If at "-O1" or higher you continue to see cases where the compiler is
doing a poor job please report them to the list and we will look at
them.
Cheers,
Carlos.
--
Carlos O'Donell
CodeSourcery
carlos at codesourcery.com
(650) 331-3385 x716
More information about the coldfire-gnu-discuss
mailing list