Given a zero initialised variable iterating through an array and multiplying its elements, the optimiser should be able to remove the loop safely and return the initial value because fast math flags are enabled.
double arr_d[1000]; double f_prod = 0; for (size_t i = 0; i < 1000; i++){ f_prod *= arr_d[i]; }
The loop here can be deleted and we can return f_prod instead
Could you pass this as an argument to the tests to avoid reading memory that's not initialized?