gnupic: SDCC warning message
Subject:
Re: SDCC warning message
From:
Scott Dattalo ####@####.####
Date:
24 Jul 2002 02:09:50 -0000
Message-Id: <Pine.LNX.4.44.0207231855050.750-100000@ruckus.brouhaha.com>
On Wed, 24 Jul 2002, Scott Gordon wrote:
> 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.
I do almost exactly that already. Could you please send me your source
file so I can see the .asm that's generated?
Scott