Assume that you compile a C or C++ source code file to an x64-based binary file by using the Visual C/C++ compiler (Cl.exe) in Microsoft Visual Studio 2010. The source code file contains a function that uses a switch statement. In this situation, incorrect machine code may be generated for the switch statement if the following conditions are true:
- The /Ob1 (Only_inline) compiler option is enabled.
- The /O1 (Minimize Size), /O2 (Maximize Speed), /Ox (Full Optimization), or /Og (Global Optimizations) optimization compiler option is enabled.
- The /GL (Whole Program Optimization) compiler option is disabled.