Grant Edwards schrieb:
On 2006-06-30, Grant Edwards <gra...@visi.com> wrote:

On 2006-06-30, David Brown <da...@westcontrol.com> wrote:


Just for fun, I tried compiling the code with "two" changed to an unsigned
char.  My mps430 compiler (3.2.3) then gives

   mov.b &P6IN, r15
   rla.b r15
   mov.b r15, &two
   ret

In other words, it makes the same mistake you did and
disregards the "volatile" qualifier.  This is far more serious
than the original question - it is incorrect code, rather than
just inefficient code.

Yow! That is pretty scary.


Rather than just complaining, I should try to fix it.  Is this
something that could be fixed by somebody like me who's only
done minor hacking on GCC?

if you already have an idea how the backend of gcc works i could think of "yes"

gcc likes to output code for volatile acceess as load/midify/store, even when with the MSP430 a single mov, bis, bic/and would be fine too. there are extra optinizations by mspgcc to genrate effient code in such a case. that migh also explain the different code at the two optimization levels. maybe someone could check with -mno-volatile-workaround

I see that there are several more recent versions of mspgcc in
CVS.  Are any of the newer ones ready for production use?  If
not, is 3.2.3 still being maintained?

3.2.3 is our "stable" version

the latest 4.x should be the next version, but it's not yet ready

chris



Reply via email to