From: SourceForge.net <no...@so...> - 2006-11-19 20:06:33
|
Bugs item #1599333, was opened at 2006-11-19 12:06 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=1599333&group_id=599 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: pic14 target Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: PIC14 - incorrect unsigned int addition Initial Comment: Current snapshot (2.6.1 #4472) contains some bug in code generation for unsigned int (and unsigned short) addition. Result is incorrect for some values of operands. My sample code: #include "pic16f84.h" void main() { volatile unsigned int i,j,k; TRISB=0; i=0x06f4; j=0x037a; k=i+j; // 0x06f4+0x037a=0x0a6e PORTB=k>>8; // just to verify MSB of result for (;;); } Result k should be 0xa6e, but is 0x66e. command used: sdcc -mpic14 -p16f84 addtest.c SDCC : mcs51/gbz80/z80/avr/ds390/pic16/pic14/TININative/xa51/ds400/hc08 2.6.1 #4472 (Nov 18 2006) (UNIX) This problem doesn't appear in last stable version (2.6.0 #4309 (Jul 28 2006) (UNIX)_. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=1599333&group_id=599 |
From: SourceForge.net <no...@so...> - 2006-11-20 22:06:20
|
Bugs item #1599333, was opened at 2006-11-19 20:06 Message generated for change (Comment added) made by tecodev You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=1599333&group_id=599 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: pic14 target >Group: fixed >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: PIC14 - incorrect unsigned int addition Initial Comment: Current snapshot (2.6.1 #4472) contains some bug in code generation for unsigned int (and unsigned short) addition. Result is incorrect for some values of operands. My sample code: #include "pic16f84.h" void main() { volatile unsigned int i,j,k; TRISB=0; i=0x06f4; j=0x037a; k=i+j; // 0x06f4+0x037a=0x0a6e PORTB=k>>8; // just to verify MSB of result for (;;); } Result k should be 0xa6e, but is 0x66e. command used: sdcc -mpic14 -p16f84 addtest.c SDCC : mcs51/gbz80/z80/avr/ds390/pic16/pic14/TININative/xa51/ds400/hc08 2.6.1 #4472 (Nov 18 2006) (UNIX) This problem doesn't appear in last stable version (2.6.0 #4309 (Jul 28 2006) (UNIX)_. ---------------------------------------------------------------------- >Comment By: Raphael Neider (tecodev) Date: 2006-11-20 22:06 Message: Logged In: YES user_id=1115835 Originator: NO Fixed in SDCC r4473. The culprit was---of course---the BANKSEL insertion code; this time, INCFSZ was turned into a NOP, just for the fun of it... ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=1599333&group_id=599 |