29.12.2014 Views

RealView Compilation Tools Compiler Reference Guide - ARM ...

RealView Compilation Tools Compiler Reference Guide - ARM ...

RealView Compilation Tools Compiler Reference Guide - ARM ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Compiler</strong> Command-line Options<br />

1 Restricted optimization. Removes unused inline functions and unused<br />

static functions. Turns off optimizations that seriously degrade the debug<br />

view. If used with --debug, this option gives a satisfactory debug view<br />

with good code density.<br />

2 High optimization. If used with --debug, the debug view might be less<br />

satisfactory because the mapping of object code to source code is not<br />

always clear.<br />

This is the default optimization level.<br />

3 Maximum optimization. -O3 performs the same optimizations as -O2<br />

however the balance between space and time optimizations in the<br />

generated code is more heavily weighted towards space or time compared<br />

with -O2. That is:<br />

• -O3 -Otime aims to produce faster code than -O2 -Otime, at the risk<br />

of increasing your image size<br />

• -O3 -Ospace aims to produce smaller code than -O2 -Ospace, but<br />

performance might be degraded.<br />

In addition, -O3 performs extra optimizations that are more aggressive,<br />

such as:<br />

• High-level scalar optimizations, including loop unrolling, for -O3<br />

-Otime. This can give significant performance benefits at a small<br />

code size cost, but at the risk of a longer build time.<br />

• More aggressive inlining and automatic inlining for -O3 -Otime.<br />

• Multifile compilation by default.<br />

Note<br />

The performance of floating-point code can be influenced by selecting an appropriate<br />

numerical model using the --fpmode option.<br />

Note<br />

Do not rely on the implementation details of these optimizations, because they might<br />

change in future releases.<br />

Default<br />

If you do not specify -Onum, the compiler assumes -O2.<br />

<strong>ARM</strong> DUI 0348A Copyright © 2007, 2010 <strong>ARM</strong> Limited. All rights reserved. 2-67<br />

Non-Confidential

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!