Bernhard Held schrieb:
The bugs may be fixed, but so many sloc variables are generated now that
there is not enough memory for my projects.  In one case the use of
internal data memory goes from 71 to 96 bytes, an unacceptable increment of
25 bytes!  And that after making all static variables in vprintf.c
volatile, otherwise the number of sloc variables is even worst.  How comes
a program with volatile variables uses less memory than the same one with
static variables?
    
Klaus, do you see a chance to fix this? Otherwise we would have to make your 
LR changes an option, e.g. by embracing them with getenv ("KLAUSLR").

  
There is a possibiliy to fix this, but not without a major change.
At the moment the liverange of an iTemp is lasting form the first definition
to the last usage (evtl. extended to the end of a loop).
If we would save for every icode which itemps are alive instead of just the start and end of a liverange,
then we could save probably some slocs again.

for example:
iTemp0 = something
...
here iTemp0 is alive
...
something = iTemp0
...
here iTemp0 is not used and the value stored in it is no more relevant
ie. here the register assigned to iTemp0 could be used again.
...
iTemp0 = ...


To my patch:
There is still a little typo in my patch:
in file SDCCloop.c, function addLoopBlocks:
in the last if clause i typed an 'i' where should be an 'j'

if (!isinSet (ebbs[i]->partOfLoop, aloop))
should be
if (!isinSet (ebbs[j]->partOfLoop, aloop))

this has no effect on the vprintf related bug, but the other bugs aren't fixed without
this little change.

Klaus