On 11 February 2011 22:26, JMGross <[email protected]> wrote:

> Hi!
>

Gidday!


> You're right, that writing to MPY isn't necessary if the write is
> redundant, but writing to OP2 is. But in this specific case, writing to MPY
> isn't redundant while OP2 is superfluous. So the code exactly does what it
> should.
> Why?
> Because you don't use b after doing the math.
>

Oh, sorry. I should have changed the test code to return a+b instead of
returning a. I was going for the simplest possible test program.

The exact same problem happens:

        push    r2
        dint
        nop
        mov.b   @r15, &__MPY
        mov.b   #llo(100), &__OP2
        mov     &__RESLO, r14
        pop     r2
        push    r2
        dint
        nop
        mov.b   1(r15), &__MPY
        mov     &__RESLO, r15
        pop     r2
        add     r14, r15

Now b is used, and is part of the expression returned in r15.

This problem is fixed in mspgcc4. Unfortunately, with mspgcc4 I then run
into other problems, with interrupt vectors not handled correctly for the
msp430x247 chip. This is apparently going to be fixed next release, due in a
few days. In the meantime, I have an ugly workaround for mspgcc3.

- Mike
------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Mspgcc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users

Reply via email to