This is the mail archive of the gcc@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: PR 23046. Folding predicates involving TYPE_MAX_VALUE/TYPE_MIN_VALUE(Ada RFC)


Laurent GUERBY wrote:

My understanding is that VRP (the compiler) is free to remove all other
language mandated range checks based on type min/max information but has
to keep the ones generated for 'Valid.

and any implicit validity checks, and for gnat, validity checks from -gnatVa

An implementation model could be for the front-end to generate for each family of scalar type T a function Base_Type_Internal_Valid (X, Min, Max : in Base_Type_Of_T) return Boolean, generate a call to it at all 'Valid uses and then tell the compiler to never do any inlining at all on such generated function.

sounds ver inefficient, remember that many left hand side array references require implicit validity checks.

Since I think there are not that many scalar base types around, I guess such functions could even be included in the Ada RTS and not generated on the fly.

Of course performance wouldn't be as good as possible, but if
there's no other way...

Laurent




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