Toolchain, asm parameters numbering and optimisation flags

fred at aidounix.com fred at aidounix.com
Tue Dec 5 12:45:21 UTC 2006


Hello,

I'm just trying to optimize the speex codec for the coldfire CPU.
Using the CodeSourcery toolchain, I have strange behaviour (I think)
of GCC.
I've attached the C source code, then the results of :
m68k-uclinux-gcc -Wa,--register-prefix-optional -Wa,-memac -Wa,-mcpu=5208
-mcpu=5208  -O2 -S -o test.O2.s test.c

and

m68k-uclinux-gcc -Wa,--register-prefix-optional -Wa,-memac -Wa,-mcpu=5208
-mcpu=5208  -O0 -S -o test.O0.s test.c

For the O2 flag, only the D0 register is used, mixing it as a temporary
data holder, and as a results holder.
For the O0 flag, as you can see line 37 of test.O0.s it is used as
the "len" parameter and as the "sum" result variable.

I'm really lost. I have only ARM inline asm experience. I suspect it's
a very simple problem, but I can't, after days of search, find a
solution nor an explication

Does someone hav an hint? please :-)

Thanx in advance
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.c
Type: text/x-csrc
Size: 1196 bytes
Desc: not available
URL: <http://sourcerytools.com/pipermail/coldfire-gnu-discuss/attachments/20061205/c909e118/attachment.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.O0.s
Type: application/octet-stream
Size: 1692 bytes
Desc: not available
URL: <http://sourcerytools.com/pipermail/coldfire-gnu-discuss/attachments/20061205/c909e118/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.O2.s
Type: application/octet-stream
Size: 1211 bytes
Desc: not available
URL: <http://sourcerytools.com/pipermail/coldfire-gnu-discuss/attachments/20061205/c909e118/attachment-0001.obj>


More information about the coldfire-gnu-discuss mailing list