From: SourceForge.net <no...@so...> - 2008-12-16 23:33:03
|
Bugs item #2435941, was opened at 2008-12-16 15:33 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=2435941&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: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Colin D Bennett (cbennett) Assigned to: Nobody/Anonymous (nobody) Summary: Compiler crash w/ large model: Internal error (gen.c:441) Initial Comment: I have encountered an internal compiler error when compiling a particular bit of code for the 8051 (mcs51) using the large memory model and a re-entrant function. If the small memory model is used or if the function is made non-reentrant, then it compiles successfully (although the generated code is incorrect! I will post separately about the code generation error). However, this particular re-entrant function has no local variables, parameters, or return value. I think that SDCC is, however, creating a temporary stack variable for the value of the "(now - updated)" expression, and perhaps it is confused since SDCC thought it was not going to require storage for any local variables. Compiler Error ============== $ ~/bin/sdcc/bin/sdcc -mmcs51 -c --model-small bad.c $ ~/bin/sdcc/bin/sdcc -mmcs51 -c --model-large bad.c bad.c:16: error 9: FATAL Compiler Internal Error in file 'gen.c' line number '441' : getFreePtr should never reach here Contact Author with source code SDCC version ============ I am using SDCC svn revision 5287, though I also tested rev 5252, which also exhibits the same error. $ ~/bin/sdcc/bin/sdcc --version SDCC : mcs51 2.8.4 #5287 (Dec 16 2008) (UNIX) Source Code (bad.c) =================== ------------------------------------------------------------ #include <stdint.h> uint32_t sleep_timer_get(void); int32_t remaining; uint32_t updated; uint32_t now; static void do_test(void) __reentrant { while (1) { now = sleep_timer_get(); remaining -= (now - updated) & 0xFF; updated = now; } } ------------------------------------------------------------ Regards, Colin ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=2435941&group_id=599 |