OpenMP standard defines "for" loop only for integer, pointer and iterator types, not for floating point types:
http://www.openmp.org/wp-content/uploads/openmp-4.5.pdf#page=62
2.7.1 Loop Construct
#pragma omp for [clause[ [,] clause] ... ] new-line
for-loops
Specifically, all associated for-loops must have canonical loop form
(see Section 2.6 on page 53).
2.6 Canonical Loop Form
A loop has canonical loop form if it conforms to the following:
for (init-expr; test-expr; incr-expr) structured-block
init-expr
One of the following:
var = lb
integer-type var = lb
random-access-iterator-type var = lb
pointer-type var = lb
...
incr-expr
One of the following:
++var
var++
-- var
var --
var += incr
var -= incr
var = var + incr
var = incr + var
var = var - incr
var
One of the following:
- A variable of a signed or unsigned integer type.
- For C++, a variable of a random access iterator type.
- For C, a variable of a pointer type.
The canonical form allows the iteration count of all associated loops to be computed before executing the outermost loop
So, for non-canonical types compiler can't compute iteration counts.
for (int i=0; i<100; i++) { double x=0.1*i; sum += x*x; }
– Jonathan Dursi