CODE GENERATION
Function
-CswMinLB<number>
<number>: a positive number denoting the number of labels.
Backend-dependent
None
None
This option allows changing the default strategy of the Compiler using tables for switch statements.
Normally the Compiler uses a table for switches with more than about 8 labels (case entries) (actually this number is highly backend-dependent). If there are not enough labels for a table, a branch tree is generated (tree of if-else-if-else). This branch tree is like an `unrolled' binary search in a table which evaluates very fast the associated label for a switch expression.
Using a branch tree instead of a table may increases the code execution speed, but it probably increases the code size. In addition, because the branch tree itself uses no special runtime routine for switch expression evaluation, debugging may be much easier.
To disable any tables for switch statements, just set the minimum number of labels needed for a table to a high value (e.g., 9999):
-CswMinLB9999 -CswMinSLB9999.
When disabling simple tables it usually makes sense also to disable search tables with the -CswMinSLB option.
Compiler options :