Compilation Mode
Ian Lance Taylor
iant@google.com
Tue May 20 19:02:00 GMT 2008
QiangHuang <qianghuang87@gmail.com> writes:
> I learned that gcc has two kinds of compilation mode, one for
> "unit-at-a-time" and the other one for "function-at-a-time".
>
> Could someone tell me the exact difference between them ?
In unit-at-a-time mode, every function in the file is converted to
GIMPLE, inlining is run, and then each function is converted to RTL
and then assembler code. In function-at-a-time mode, each function is
converted to GIMPLE, then to RTL, then to assembler code. Thus one
difference is whether a function can inline a function defined later
in the source file.
In general gcc is moving to supporting only unit-at-a-time mode. The
only reason to ever use function-at-a-time mode is to reduce the
memory requirements of the compiler. It should not be used for any
other reason.
Ian
More information about the Gcc-help
mailing list