I have a small example of the problem that occurred when switching from VS2013 to VS2015. In VS2015, the following code example causes an invalid floating point operation.

int main()
{
unsigned int enableBits = _EM_OVERFLOW | _EM_ZERODIVIDE | _EM_INVALID;
_clearfp();
_controlfp_s(0, ~enableBits, enableBits);
int count = 100;
float array[100];
for (int i = 0; i < count; ++i)
{
array[i] = (float)pow((float)(count - 1 - i) / count, 4);
}
return 0;
}
This only happens in release mode, so it’s probably due to another optimization. Is there something wrong with this code or is this a bug in VS 2015?
It is difficult to find such problems on the entire code base, so I'm looking for some kind of systematic fix, and not a workaround (for example, use another variable instead of i that works)
, , , VS2013 128- 4 . VS2015, , 2 , ( ), , , .
, , .
VS2013

VS2015

.
.