3.3.3 Optimization Options
Keywords: sdccman

##
3.3.3 Optimization Options

- [—nogcse] Will not do global common subexpression elimination, this option may be used when the compiler creates undesirably large stack/data spaces to store compiler temporaries (spill locations, sloc). A warning message will be generated when this happens and the compiler will indicate the number of extra bytes it allocated. It is recommended that this option NOT be used, #pragma nogcse can be used to turn off global subexpression elimination for a given function only.
- [—noinvariant] Will not do loop invariant optimizations, this may be turned off for reasons explained for the previous option. For more details of loop optimizations performed see Loop Invariants in section 8.1.4. It is recommended that this option NOT be used, #pragma noinvariant can be used to turn off invariant optimizations for a given function only.
- [—noinduction] Will not do loop induction optimizations, see section strength reduction for more details. It is recommended that this option is NOT used, #pragma noinduction can be used to turn off induction optimizations for a given function only.
- [—noloopreverse] Will not do loop reversal optimization.
- [—nolabelopt] Will not optimize labels (makes the dumpfiles more readable).
- [—no-xinit-opt] Will not memcpy initialized data from code space into xdata space. This saves a few bytes in code space if you don't have initialized data.
- [—nooverlay] The compiler will not overlay parameters and local variables of any function, see section Parameters and local variables for more details.
- [—no-peep] Disable peep-hole optimization with built-in rules.
- [—peep-file <filename>] This option can be used to use additional rules to be used by the peep hole optimizer. See section 8.1.16 Peep Hole optimizations for details on how to write these rules.
- [—peep-asm] Pass the inline assembler code through the peep hole optimizer. This can cause unexpected changes to inline assembler code, please go through the peephole optimizer rules defined in the source file tree '<target>/peeph.def' before using this option.
- [—peep-return] Let the peep hole optimizer do return optimizations. This is the default without —debug.
- [—no-peep-return] Do not let the peep hole optimizer do return optimizations. This is the default with —debug.
- [—opt-code-speed] The compiler will optimize code generation towards fast code, possibly at the expense of code size.
- [—opt-code-size] The compiler will optimize code generation towards compact code, possibly at the expense of code speed.
- [—fomit-frame-pointer] Frame pointer will be omitted when the function uses no local variables. On the z80-related ports this option will result in the frame pointer always being omitted.
- [—max-allocs-per-node] Setting this to a high value will result in increased compilation time (and increased memory use during compilation) and more optimized code being generated. Setting it to lower values speeds up compilation, but does not optimize as much. The default value is 3000. This option currently does not affect the mcs51, ds390, pic14 and pic16 ports.
- [—nolospre] Disable lospre. lospre is an advanced redundancy elimination technique, essentially an improved variant of global subexpression elimination.
- [—allow-unsafe-read] Allow optimizations to generate unsafe reads. This will enable additional optimizations, but can result in spurious reads from undefined memory addresses, which can be harmful if the target system uses certain ways of doing memory-mapped I/O.
- [—nostdlibcall] Disable the optimization of calls to the standard library.