This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Stickiness of TYPE_MIN_VALUE/TYPE_MAX_VALUE
- From: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- To: fw at deneb dot enyo dot de
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 30 May 05 16:05:09 EDT
- Subject: 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.