C/C++ Compiler (cl.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
Specify Type of Frame Sorting (/Ov)
                                             Up Contents Index Back
─────C/C++ Compiler─────────────────────────────────────────────────────────
 
     Syntax:  /Ov
              /Ov-
 
     The /Ov option enables a p-code size optimization that changes
     the order in which local variables are referenced in memory. This
     option must be used in conjunction with the /Oq option.
     See: Maximum P-Code Optimization (/Oq)
 
     The compiler reduces the size of p-code programs by using one-
     byte opcodes to reference local variables. These opcodes are
     frame-relative addresses, and only a limited number of them are
     available for each function. The optimizer uses one of two
     algorithms to determine which variables receive the available
     opcodes.
 
     Option     Description
 
     /Ov        Sorts the local variables by frequency of use (default)
 
     /Ov-       Sorts the local variables in the order that they occur
                (lexical order)
 
     NOTE: In most cases, the default value for this option is
           satisfactory. In rare cases, local variables in large
           functions are sorted so that commonly referenced variables
           are referenced with double-byte opcodes. You can rewrite the
           function and place the most frequently used local variables
           at the beginning of the function block. Then use the /Ov-
           option to ensure that the local variables are sorted on the
           stack lexically. The variables that you place first in the
           function are referenced with single-byte opcodes.
                                    -♦-