Hi, > As far as I get it, there is no real failure here. > Parloop, unaware of the array's upper bound, inserts the 'enough > iterations' condition (i>400-1), and thereby > makes the last iteration range from 400 upwards. > VRP now has a constant it can compare to the array's upper bound. > Correct programs that do not exceed the array bound will now fail because > VRP is not aware of the > fact that the parallel code (and last iteration it is looking at) is > actually not executed in these cases. > > I'm not sure how to proceed, in order to avoid this warning. > Any ideas?
I would propose changing the test expected_loop_iterations (loop) <= n_threads in tree-parloops.c to ((nit = estimated_loop_iterations_int (loop, false)) >= 0 && nit < MIN_PER_THREAD * n_threads) Which should prevent the parallelization for this loop, as we should be able to derive that the loop iterates at most 4 times due to the array access. Zdenek