From: SourceForge.net <no...@so...> - 2004-09-15 08:32:45
|
Bugs item #1027588, was opened at 2004-09-14 02:02 Message generated for change (Settings changed) made by vrokas You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=1027588&group_id=599 Category: pic16 target >Group: fixed >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: ccsporters (tecodev) >Assigned to: Vangelis Rokas (vrokas) Summary: mul/div in the PIC16 port Initial Comment: The following code fails: int main () { volatile unsigned int val1, val2, res; volatile long f1, f2, prod; f1 = 2L; f2 = 4L; prod = f1 * f2; /* BUG1 */ prod = 2L * f2; prod = f1 * 4L; prod = 2L * 4L; val1 = 0x30d4; val2 = 0x123; res = val1 / val2; res = val1 / 0x123; res = ((unsigned int)0x30d4) / val2; /* BUG2 */ res = ((unsigned int)0x30d4) / 0x123; return res; } Compiled using "sdcc -mpic16 -p18f452 --no-crt div.c" with SDCC : pic16 2.4.4 #838 (Sep 13 2004) (UNIX) two bugs occur: (BUG1) long multiplication cannot be performed natively, fix line 700, main.c from "<= 4" to "< 4" works fine (calls the library function) [comment out BUG2 to compile] (BUG2) compiling aborts here with an assertion: Internal error: validateOpType failed in OP_SYMBOL(IC_LEFT(ic)) @ main.c:700: expected symbol, got value Modifying main.c:700f to read if((ic->op == '*') && (getSize(OP_SYMBOL(IC_LEFT(ic))->type) < 4)) return TRUE; circumvents both errors. Greetings, Raphael Neider ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=1027588&group_id=599 |