Compiler Options
3-3
to the file; in this case, the necessity of
-mlong_call
does not depend
on other files or on the link order—this kind of file will either always
require
-mlong_call
or it will never require it. Note that with SDCC, the
use of
-mlong_call
does not guarantee that all calls will be long calls;
that is, the assembly optimizer,
sdopt
, will convert long calls to call
immediates if it can determine that such a conversion is safe. The
assembly optimizer can be disabled by specifying the
-mno_sdopt
option; otherwise, it is automatically invoked when optimization is
selected. Note that to debug optimized code, the
-mno_sdopt
option
should be used, because the assembly optimizers perform optimizations
that make debugging extremely difficult.
sdopt
takes in assembly generated by the compiler proper and
optimizes it to produce improved assembly. The optimizations that
sdopt
performs include simplification of constant generation, conversion of
loops to use loop registers, dead code elimination, loop invariant code
motion, conversion of long calls to call-immediate, instruction scheduling,
and improved register utilization.
zdopt
takes in assembly generated by ZDCC and optimizes it to
produce improved assembly. The optimizations that
zdopt
performs
include dead code elimination, loop invariant code motion, instruction
scheduling, and improved register utilization.
ZDCC supports two models of memory. The default small memory model
requires that data and bss sections be placed in the first 64K words of
data memory. The large data model has no requirements on the size or
placement of the data and bss sections. The large data model is selected
with the “-
mlarge_data
” option. For both models, the pointer size is 32-
bits. Both models allow stack and heap space to use all addressable
memory. Code generated with the small data model will be more
compact and have better performance than code generated with the
large data model. The small data model allows a shorter instruction
sequence to be used to access memory in the data or bss sections.