This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: basic VRP min/max range overflow question


Gabriel Dos Reis wrote:
> Sebastian Pop <sebastian.pop@cri.ensmp.fr> writes:
> 
> [...]
> 
> | +@item -Wloop-bound-estimated
> | +@opindex Wloop-bound-estimated
> | +Warn when an estimation of the number of iterations is computed based
> | +on the fact that compiled programs are correct and do not invoke
> | +undefined behavior.
> 
> I think the documentation would need to be less vague about the
> precondition -- there are many sources of "undefined behaviour" :-)
> 

Well, then there are many sources from which to extract useful
informations as estimations of the loop bounds ;-)

Probably we need a different warning flag for each of these places
that extract information from undefined behaviour, then in the end a
single flag to trigger all of these.

I propose to change the warning flag to:
-Wloop-bound-estimated-by-accessed-data-size
then to have another warning for:
-Wloop-bound-estimated-by-signed-iv-ranges
In the end, having all of these flags triggered by
-Wloop-bound-estimated.

What about the following documentation for 
-Wloop-bound-estimated-by-accessed-data-size
Warn when an estimation of the number of iterations is computed based
on the access functions used in a loop to access an array of known
size.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]