Robert Dewar wrote:
>
> As with all warnings, you have to run this over a large test suite
> of real applications to find out whether there are too many false
> positives.
I don't really see what a false positive could be in this case. In
the patch that I have proposed, the warning is triggered every time
the flag -Wloop-bound-estimated is used and the loop optimizer
triggers the estimation of loop bounds for a parametric loop, as in
the following:
void foo (int N)
{
int i;
int A[123];
for (i = 0; i < N; i++)
A[i] = ...
}
The warning would say something like "<file>:<line> undefined behavior
if loop runs more than 122 iterations: access over allocated data
bounds".
Sebastian