Bryan Kattwinkel

CW 6.3 ColdFire doesn't use post-increment

Discussion created by Bryan Kattwinkel on Mar 8, 2007
Latest reply on Mar 8, 2007 by Bryan Kattwinkel
If I do a structure assignment, CodeWarrior compiles a compact loop to copy the data using post-increment addressing (I can see it in the disassembly). The equivalent C code looks like:

do { *d++ = *s++; } while (--len);

But if I write this code in C, CW compiles a much bigger and slower loop that does not take advantage of the post-increment addressing mode. Except for structure assignment, I have not seen any use of post-increment by the CW ColdFire compiler.

I remember using a non-optimizing C compiler over 20 years ago, and for architectures with post-increment (and pre-decrement), if you wrote it in the C code you got it in the machine language.

You may say I should use library memcpy, etc. to do these type of things. But FreeScale has given me software for the eval board (52233) which does not use the library.

Outcomes