I compiled the factorial program from http://software.intel.com/en-us/articles/parallel-lint/#IDAUZY0E (see below) with ICC 12.0.1.096 from Parallel Studio 2011 using the options /Qopenmp and /Qdiag-enable:sc-parallel2. According to the manual, the compiler should emit a warning due to a dependency between the loop iterations in the example, but it doesn't. Any ideas why no warning is emitted?
There is indeed data dependence in the loop. The reason no dependency is reported is that per OpenMP specification, OpenMP is an assertion-based parallelization model, that is the compiler complies with whatever the user asserts/intends by the use of the OMP pragma so the compiler does not do any dependency checking. That was one of the reasons behind the development of the Intel Inspector XE 2011 available in the Intel Parallel Studio XE. If you run your test case under Intel Parallel Inspector, the inspector will report:
"One or more threads in the application accessed the stack of another thread. This may indicate one or more bugs in your application. Setting the Intel Inspector XE 2011 to detect data races on stack accesses and running another analysis may help you locate these and other bugs. "
The Intel C++ Compiler Vectorizers will report the data dependency as follows:
> icc -w -vec-report3 -c t.c t.c(9): (col. 7) remark: loop was not vectorized: existence of vector dependence. t.c(10): (col. 9) remark: vector dependence: assumed FLOW dependence between factorial line 10 and factorial line 10.