-qsmallstack

Category

Optimization and tuning

@PROCESS

None.

Purpose

Minimizes stack usage where possible.

This compiler option controls two distinct, but related sets of transformations: general small stack transformations and dynamic length variable allocation transformations. These two kinds of transformations can be controlled independently of each other.

Syntax

Read syntax diagramSkip visual syntax diagram
        .-nosmallstack--------------------------.   
>>- -q--+-smallstack--+-----------------------+-+--------------><
                      '-=--+-dynlenonheap---+-'     
                           '-nodynlenonheap-'       

Defaults

-qnosmallstack

Parameters

dynlenonheap | nodynlenonheap
The -qsmallstack=dynlenonheap suboption affects automatic objects that have nonconstant character lengths or a nonconstant array bound (DYNamic LENgth ON HEAP). When specified, those automatic variables are allocated on the heap. When this suboption is not specified, those automatic variables are allocated on the stack.

Defaults

The default, –qnosmallstack, implies that all suboptions are off.

Usage

Using this option may adversely affect program performance; it should be used only for programs that allocate large amounts of data on the stack.

-qsmallstack with no suboptions enables only the general small stack transformations.

-qnosmallstack only disables the general small stack transformations. To disable dynlenonheap transformations, specify -qsmallstack=nodynlenonheap as well.

-qsmallstack=dynlenonheap enables the dynamic length variable allocation and general small stack transformations.

To enable only the dynlenonheap transformations, specify -qsmallstack=dynlenonheap -qnosmallstack .

When both -qsmallstack and -qstacktemp options are used, the -qstacktemp setting will be used to allocate applicable temporary variables if it is set to a non-zero value, even if this setting conflicts with that of -qsmallstack. The -qsmallstack setting will continue to apply transformations not affected by -qstacktemp.

Related information