Quantcast
Channel: Intel Developer Zone Articles
Viewing all articles
Browse latest Browse all 3384

-ansi-alias is enabled by default at -O2 and above on Linux*

$
0
0

This change was introduced in Intel® C++ Compiler 15.0 for Linux.

To align more closely with gcc, -ansi-alias is enabled by default at –O2 and above.  gcc enables -fstrict-aliasing, the alternate option of -ansi-alias, at -O2, -O3 and -Os.

-ansi-alias

This option tells the compiler to assume that the program adheres to ISO C Standard aliasability rules. If your program adheres to the ANSI aliasability rules, this option allows the compiler to optimize more aggressively.

If your program does not adhere to these rules, this option may cause the compiler to generate incorrect code.

This option allows Intel compiler to do more aggressive optimizations when generating code.  If your code does not adhere these rules or you are not sure, use -no-ansi-alias or -fno-strict-aliasing.

-ansi-alias-check option enables the ansi-alias checker in Intel compiler.  The ansi-alias checker checks the source code for potential violations of ANSI aliasing rules and disables unsafe optimizations related to the code for those statements that are identified as potential violations.  You can use this option to identify potential violations.  However, ansi-alias checker may not catch all violations.

For more details of strict aliasing rules, please refer to C99 standard [ISO/IEC 9899:1999] section 6.5 and C++03 standard [ISO/IEC 14882] section 3.10.


Viewing all articles
Browse latest Browse all 3384

Trending Articles