Skip to main content
Visitor II
July 14, 2018
Question

Does is SDCC the DCE optimisation?

  • July 14, 2018
  • 1 reply
  • 1504 views
Posted on July 14, 2018 at 07:05

Hello anyone,

When compiling a program including Standard Peripheral Library in the output *.elf file, all unused modules was included. Does is SDCC the dead code elimination optimization and how to activate it?

Thanks in advance.

#dce #optimalization #sdcc #stm8-toolchain
    This topic has been closed for replies.

    1 reply

    Visitor II
    July 14, 2018
    Posted on July 14, 2018 at 16:50

    '

    Does is SDCC the dead code elimination optimization and how to activate it?'

    it does, in such a way that it doesn't.

    you will need to put each function in a separate file for the unused functions to not be linked in. for modern modular programming, that's not a workable approach.

    Visitor II
    July 14, 2018
    Posted on July 14, 2018 at 20:07

    It's a pity. All modern compilers exclude unused functions from the code. Those, assembly occurs at the level of object files, not by functions. As in the first compilers. And there is no undocumented magic key?   Thanks.

    Visitor II
    July 15, 2018
    Posted on July 15, 2018 at 22:42

    '

    It's a pity.

     '

    indeed. it essentially made the compiler unusable - i ruled it out very early based on that.