humble_student
humble_student

Reputation: 21

What is the equivalent of GCC's fno-strict-aliasing flag for ICC, the Intel Compiler?

The Intel compiler appears to accept the -fno-strict-aliasing flag verbatim, but I have not seen that behavior documented anywhere, and the flag may be ignored. Flags such as -no-ansi-alias look related, but I want to be sure I specify exactly the right behavior.

(Reminder: this question is about ICC-classic, not LLVM-based ICX.)

Upvotes: 2

Views: 1353

Answers (2)

tim18
tim18

Reputation: 620

When these replies were posted, Intel compilers did in fact default to -fno-ansi-alias, but it has since changed (at least for linux).

Upvotes: 2

Paul R
Paul R

Reputation: 212929

ICC accepts most gcc switches and does the right thing with them. If you want to use the ICC-specific switch though then I think this is probably the one:

-[no-]ansi-alias
          enable/disable(DEFAULT) use of ANSI aliasing rules optimizations;
          user asserts that the program adheres to these rules

Upvotes: 3

Related Questions