Is there anybody other than me who see the visual studio 2017 optimizer fail on relatively trivial things? That's completely unbelievable. The code below works correctly with #pragma optimize( "", off ) and fails with #pragma optimize( "", on )

Code: Select all

```
// testing db read/write methods
if (p_array[idx].parameter1 != t_value.parameter1 ||
p_array[idx].parameter2 != t_value.parameter2 ||
p_array[idx].parameter3 != t_value.parameter3 ||
p_array[idx].parameter4 != t_value.parameter4 ||
p_array[idx].parameter5 != t_value.parameter5 ||
p_array[idx].parameter6 != t_value.parameter6 ||
p_array[idx].parameter7 != t_value.parameter7 ||
(fabs(p_array[idx].parameter8 - t_value.parameter8) > 1E-6) ||
(fabs(p_array[idx].parameter9 - t_value.parameter9) > 1E-6) ||
(fabs(p_array[idx].parameter10 - t_value.parameter10) > 1E-6))
{
std:cerr << "Incorrect values returned by GetRecord:\n";
std:cerr << "parameter1: '" << p_array[idx].parameter1 << "' vs '" <<t_value.parameter1 << "'\n";
std:cerr << "parameter2: '" << p_array[idx].parameter2 << "' vs '" << t_value.parameter2 << "'\n";
std:cerr << "parameter3: '" << p_array[idx].parameter3 << "' vs '" << t_value.parameter3 << "'\n";
std:cerr << "parameter4: '" << p_array[idx].parameter4 << "' vs '" << t_value.parameter4 << "'\n";
std:cerr << "parameter5: '" << p_array[idx].parameter5 << "' vs '" << t_value.parameter5 << "'\n";
std:cerr << "parameter6: '" << p_array[idx].parameter6 << "' vs '" << t_value.parameter6 << "'\n";
std:cerr << "parameter7: '" << p_array[idx].parameter7 << "' vs '" << t_value.parameter7 << "'\n";
std:cerr << "parameter8: '" << p_array[idx].parameter8 << "' vs '" << t_value.parameter8 << "'\n";
std:cerr << "parameter9: '" << p_array[idx].parameter9 << "' vs '" << t_value.parameter9 << "'\n";
std:cerr << "parameter10: '" << p_array[idx].parameter10 << "' vs '" << t_value.parameter10 << "'\n";
return false;
}
```