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: Stickiness of TYPE_MIN_VALUE/TYPE_MAX_VALUE


    How sticky are TYPE_MIN_VALUE and TYPE_MAX_VALUE?  Is it possible to
    get rid of their effect using a NOP_EXPR, CONVERT_EXPR or
    VIEW_CONVERT_EXPR?

I don't really understand either question.  Also, as to the second,
keep in mind their role in array indexes.

    If this is impossible, the Ada front end should probably stop setting
    these fields because it assumes that it can use values outside that
    range:

    http://gcc.gnu.org/onlinedocs/gcc-4.0.0/gnat_ugn_unw/Validity-Checking.html

I don't understand what that chapter has to do with your statement.

There is an outstanding PR where Ada is using the wrong type to store
intermediate values.

A much trickier question comes up in the handling of the 'Valid attribute
because the purpose of that attribute is precisely to determine whether
a value is within the bounds of its type. But that can only be used in
very specific circumstances and should not dictate the way the type
system is used.


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