Jacob Andersen wrote:
I haven't been able to find any references to this error among recent
posts on this list. My apologies, if this turns out to be an old issue ;-)
When any optimization is active (i.e. -Ox for any x>0) msp430-gcc emits
illegal assembly code for calls to memset with length=2 and a pointer
which points to an odd address (i.e. not a word boundary).
I think you should rebuild your toolchain from last cvs sources or get last pre-built windows
package. Take a look at this discussion:
http://sourceforge.net/mailarchive/forum.php?thread_name=12756.43830.qm%40web28410.mail.ukl.yahoo.com&forum_name=mspgcc-users
I can't reproduce your bug with my current toolchain:
103 .LM8:
104 001a B240 5555 mov #llo(21845), &array
104 0000
105 .LM9:
106 0020 B240 5555 mov #llo(21845), &array+2
106 0000
107 .LM10:
108 0026 2E43 mov #llo(2), r14
109 0028 3F40 0000 mov #array+1, r15
110
111 .Lcsn24:
112 002c CF43 0000 clr.b 0(r15)
113 0030 1F53 inc r15
114 0032 1E83 dec r14
115 0034 FB23 jnz .Lcsn24
116 .LM11:
Of course this code is not effective at all, but it works as desired.
Anyway, thank you for pointing at this, we should make inline version of memset
more effective.
--
Regards,
Sergey A. Borshch mailto: [email protected]
SB ELDI ltd. Riga, Latvia