-qcompact

Purpose

Avoids optimizations that increase code size.

Syntax

Read syntax diagramSkip visual syntax diagram
        .-nocompact-.   
>>- -q--+-compact---+------------------------------------------><

Defaults

-qnocompact

Usage

Code size is typically reduced by inhibiting optimizations that replicate or expand code inline, such as inlining or loop unrolling. Execution time might increase.

This option takes effect only when it is specified at the -O2 optimization level, or higher.

Predefined macros

__OPTIMIZE_SIZE__ is predefined to 1 when -qcompact and an optimization level are in effect. Otherwise, it is undefined.

Examples

To compile myprogram.c, instructing the compiler to reduce code size whenever possible, enter:

xlc myprogram.c -O -qcompact


Voice your opinion on getting help information Ask IBM compiler experts a technical question in the IBM XL compilers forum Reach out to us