PR 23046. Folding predicates involving TYPE_MAX_VALUE/TYPE_MIN_VALUE (Ada RFC)
Florian Weimer
fw@deneb.enyo.de
Fri Aug 5 20:33:00 GMT 2005
* Richard Kenner:
> This is wrong (as discussed before) and is likely the cause of PR21573
> (not VRP-related, the expanders for SWITCH_EXPR look at these
> attributes, too). I'm not sure if it is safe to delete these
> assignment statmeents because TYPE_MIN_VALUE/TYPE_MAX_VALUE are used
> quite extensively throught GIGI.
>
> Well, what *should* they be set to? That is indeed setting them to the
> minimum and maximum values as defined by the language.
No, the language (or, more precisely, GNAT) defines them as 0 and
2**size - 1. Otherwise the 'Valid attribute doesn't work. Necessary
range checks will be optimized away, too.
More information about the Gcc
mailing list