[Icc-avr] Compiler bug?

John Baraclough j_baraclough at zetnet.co.uk
Fri May 4 09:26:36 PDT 2007


Hi Bengt,

I assume the function at 0x00000A68 in your first 
listing is 'div16s', in which case the result is 
returned in R16/R17. That being so, then the 
first parameter being passed to the function

S_ShortFilter(ppgAcDiff, &filtMem[channel], filterdjup, &firFiltMem[channel]);

is already in the correct register pair and 
doesn't need to be moved. Sorry, but I don't 
think he problem is with the compiler.

All the best for now,
John


At 13:44 04/05/2007, you wrote:
>Hi.
>
>I know that I am usually wrong about this but 
>this looks like a compiler bug to me. Please have look.
>
>ppgAcDiff and acGain are signed short.
>
>This simple line didn’t do anything so I checked 
>the assembler. Actually this is very similar to 
>my previous problem but this time the variable 
>is used at the line right after. Just to 
>provoke, I inserted a simple ++ in between and 
>yes, now the result is saved. What is going on here?
>
>ppgAcDiff = ppgAcDiff/acGain;
>
>
>411:                ppgAcDiff = ppgAcDiff/acGain;
>+0000020D:   019C        MOVW    R18,R24          Copy register pair
>+0000020E:   0187        MOVW    R16,R14          Copy register pair
>+0000020F:   940E0A68    CALL    0x00000A68       Call subroutine
>414:                subtractTotalDiffFiltered = 
>S_ShortFilter(ppgAcDiff, &filtMem[channel], filterdjup, &firFiltMem[channel]);
>
>
>
>411:                ppgAcDiff = ppgAcDiff/acGain;
>+0000020D:   019C        MOVW    R18,R24          Copy register pair
>+0000020E:   0187        MOVW    R16,R14          Copy register pair
>+0000020F:   940E0A6D    CALL    0x00000A6D       Call subroutine
>+00000211:   0178        MOVW    R14,R16          Copy register pair
>412:      ppgAcDiff++;
>+00000212:   01C7        MOVW    R24,R14          Copy register pair
>+00000213:   9601        ADIW    R24,0x01         Add immediate to word
>+00000214:   017C        MOVW    R14,R24          Copy register pair
>414:                subtractTotalDiffFiltered = 
>S_ShortFilter(ppgAcDiff, &filtMem[channel], filterdjup, &firFiltMem[channel]);
>
>/Bengt
>________________________________________________________________
>
>Bengt Ragnemalm                        Tel +46 13 22 24 97
>
>Research engineer                                       FAX: +46 13 10 19 02
>
>Linköpings 
>Universitet 
><mailto:bengt.ragnemalm at imt.liu.se>mailto:bengt.ragnemalm at imt.liu.se
>
>Inst. för Medicinsk Teknik 
>Internet:        <http://www.imt.liu.se/>http://www.imt.liu.se
>
>S-581 85 Linköping SWEDEN
>
>
>
>_______________________________________________
>Icc-avr mailing list
>Icc-avr at imagecraft.com
>http://dragonsgate.net/mailman/listinfo/icc-avr
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20070504/6d56e7e1/attachment-0001.html


More information about the Icc-avr mailing list