gnupic: SDCC warning message


Previous by date: 24 Jul 2002 01:59:37 -0000 prototyping board for PIC devices, Mengjin Su
Next by date: 24 Jul 2002 01:59:37 -0000 Re: SDCC warning message, Scott Dattalo
Previous in thread: 24 Jul 2002 01:59:37 -0000 Re: SDCC warning message, Scott Dattalo
Next in thread: 24 Jul 2002 01:59:37 -0000 Re: SDCC warning message, Scott Dattalo

Subject: Re: SDCC warning message
From: Scott Gordon ####@####.####
Date: 24 Jul 2002 01:59:37 -0000
Message-Id: <Pine.LNX.4.10.10207241132340.30495-100000@term10.physics.uq.edu.au>

Hi Scott,

Thanks for the help (below). The program compiles okay now, but does not
assemble.

The assembly stage (I think) bombs out due to the large number of temporary
variables creating inside functions, and the inability to store these in the
available memory. The assembler also complains about things being in the wrong
bank, but that may be a harmless warning.

I noticed from looking at the .asm file produced that temporaries and local
variables inside functions are never reused in other functions, even if they
never call each other, which seems to be the cause of the problem.

I'd like to suggest the following optimisation (please tell me if this is
already planned / you're the wrong person) to be done after regular code
optimisation but before assigning physical registers to the `psuedo' ones on
which optimisation works [ its basically a tree traversal ] :

Step 1. Compile a list of all functions called (or jumped to) from within each
function in the program. Possibly precautions must be taken for inline assembly
or when a function is called through a pointer to its address, eg. mark the
function containing these as calling EVERY other function.

Step 2. For every function `A' do : For each entry `B' in a function `A's list,
add the whole list for function `B', to the list for function `A' (eliminating
duplicate entries).

Step 3. Repeat Step 2 until none of the lists has changed in an iteration.

Then the list for each function is a list of all functions called by it either
directly or indirectly, and which thus cannot (generally) use the same
temporary register space.

Step 4. Merge the temporary/local registers for any functions which never call
each other, ie. any functions A and B for which A is not in B's list or vice
versa, thus saving memory space.

Cheers
Scott




On Mon, 22 Jul 2002, Scott Dattalo wrote:

> On Tue, 23 Jul 2002, Scott Gordon wrote:
> 
> > Hi,
> > 
> > Perhaps this is a silly question but ..
> > 
> > I just installed sdcc and have tried to compile a test program in C using
> > something like   sdcc -mpic14 -p16f877 blah.c   I think, but it fails with a
> > message telling me that I have to use a file produced by inc2h.pl.
> > 
> > What file is it talking about, and what do I do with it ? The message is pretty
> > cryptic so I'm stumped.
> 
> Sorry 'bout that. It is a stop-gap message that will be removed.
> 
> What you need to do is either build the include file using inc2h.pl:
> 
> sdcc/support/scripts/inc2h.pl p16f877.inc > p16f877.h
> 
> or grab this:
> 
> http://www.dattalo.com/p16f877.h
> 
> 
> Scott


Previous by date: 24 Jul 2002 01:59:37 -0000 prototyping board for PIC devices, Mengjin Su
Next by date: 24 Jul 2002 01:59:37 -0000 Re: SDCC warning message, Scott Dattalo
Previous in thread: 24 Jul 2002 01:59:37 -0000 Re: SDCC warning message, Scott Dattalo
Next in thread: 24 Jul 2002 01:59:37 -0000 Re: SDCC warning message, Scott Dattalo


Powered by ezmlm-browse 0.20.