cancel
Showing results for 
Search instead for 
Did you mean: 

(ST9PlusV6.2.0) GNU compiler problem?

gersbach
Associate
Posted on May 15, 2008 at 08:30

(ST9PlusV6.2.0) GNU compiler problem?

1 REPLY 1
gersbach
Associate
Posted on May 17, 2011 at 11:32

While debugging my project I have discovered the following behavior which does not make sense to me. I am hoping that maybe someone out there may see the reason for the problem and could give me a hint or a solution.

The following code sniped reads like this in C…

m_nValue += m_nValue;

and like this in the .lst file (listing).

ldw rro,#@m_nValue

addw @m_nValue+2,2(rr0)

adcw @m_nValue,(rr0)

m_nValue is a static long variable and it is also #pragma REGISTER_FILE m_nValue

For example, if I initialize m_nValue with 0 the output after the += function is not 0 as suggested. The output can be anywhere in the 32bit range. The output value is always the same for a compilation. If I change code and recompile the output variable is different than before.

My compile options look like this:

-m$(MODEL) -mfp-on -I$(INCDIR) -O1 -Wall -c -Wa,-alhd=$*.lis

I am using the MODEL: medium.

Any suggestions are highly appreciated.