Am 16.08.24 um 12:12 schrieb Oleg Endo:
>
> On Fri, 2024-08-16 at 17:10 +0800, 月明风清 via sdcc-devel wrote:
>>
>> Acording to my work requirement, a small 8-bit mcu with 9bit RAM
>> addr 13bit ROM addr,without banking. I use SDCC and gputils for
>> it. I have tried a lot of. Recently, I did 2 LTO pass in gputils's
>> linker: 1) remove unused global variable (initialized or
>> uninitialized). 2) Reuse temporary ram variable accross different
>> functions. In this pass , I construct the call-graph with main、
>> intterrupt0、interrupt1 as the root. when two functions are in one
>> call-graph, they can share compiler allocated global ram
>> variables. Great, it works.
>>
>>
>
> Wow, congratulations. I wish we had this working for other backends
> of SDCC.
Regarding the other backend, assuming we use the asxxxx linker:
* I hadn't thought about the RAM reuse yet. Obviously this only matters
to the ports that actually put local variables into RAM, as opposed to
on the stack. But for thisports it could be quite useful.
* The linker already can handle dependenices at the module level. And
for libraries it can handle multiple modules per file. So we'd only have
to get the linker to accept multiple modules per .rel file, and SDCC to
split the .rel files into multiple modules. Still will be some work,
including testing.
Philipp
|