The following code fails with a Floating Point (Inavlid) Exception in __svml_powf4_l9 ()
program powtest real s(1601) real power integer iz integer nz real dz character*16 out integer i power = 2.0 nz = 1601 dz = 5 i = ieee_flags('set', 'exception', 'invalid', out) ! do iz = 1, nz z = (iz-1)*dz*.005 s(iz) = z**power enddo print * , maxval(s) end
My processor is a Intel(R) Xeon(R) CPU E3-1240 v3 on Debian GNU/Linux 9.4
The FPE goes away if I compile with -fp-model consistent that looks like it is preventing the loop from being vectorized.
LOOP BEGIN at pow.f90(21,11)
remark #15527: loop was not vectorized: function call to powf cannot be vectorized [ pow.f90(23,24) ]
Or if I pass the -fpe0 flag to the compiler. This has the same effect for a different reason:
remark #15335: loop was not vectorized: vectorization possible but seems inefficient. Use vector always directive or -vec-threshold0 to override
It looks to me that something goes wrong with the vectorized version of the pow function. Any ideas?
I can reproduce what you see in the 19.0.0, 19.0.1, and 19.0.2 compilers. It seems fixed in 19.0.3 which is 2019 Update 3.
what version of the compiler are you using?
I was using 18.0.5 but can confirm that the problem is fixed in 19.0.3. Thanks a lot for that.
I am a bit surprised though that there was a bug in svml in such a fundamental computation and how this has endured so many version updates.
If you could share some more details on what was the problem I would be curious.