Reduces code size by parsing entire program before code-generation
EDN Europe, 14 Apr 2008
The PIC 10/12/16 PRO package from Hi-Tech uses “super-optimising” OCG compiler technology to minimise code size. Rather than the “global” optimisations that most compilers claim – which, says supplier Computer Solutions (ComSol), in reality optimise each individual module separately – the OCG (Omniscient Code Generator) partially analyses each module in isolation; only at the end, when it has all the details, does it generate code. This can both substantially reduce code size and allows the code generator to automatically make many decisions (memory page allocation, pointer allocation) that would otherwise need to be controlled by the programmer. An example benchmark, rating the code size produced by the conventional PICC-STD compiler at 100%, when coded with PIC 10/12/16 Pro with OCG yielded a code size of 92%. OCG reduces size by; minimising compiled stack size; in-lining of functions not called by others; using minimal register save and restore; including only formats that will be used under Sprintf(); stripping out code for un-used return values; optimising startup code size; and minimising register save in ISRs. The compiler minimises the use of non standard CPU specific C extensions, automatically handles memory bank allocation, optimises pointer variable size based on usage, catches inconsistent variable and object definition, truly optimises register allocation over the whole program, manages re-entrant and recursive calls, and allocates the most-accessed variables allocated to fastest accessed memory. The compiler is available at £575.00, including a years priority support and upgrades, until the end of April.