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)


* Robert Dewar:

> Florian Weimer wrote:
>
>> I fear that such barriers are also needed for all checks on scalars,
>> by the way, not just 'Valid.
>
> indded, and we do unchecked conversions to the base type in these
> cases. i guess we could fix the enum case by using unsigned as the
> arg type, but that would not help the general case.

It would also fail when the 'Valid code is inlined and the tree
optimizers propagate the range information present in the enumeration
type.

> why can't we just completely turn off this optimization for Ada
> since it is wrong!

If I read the documentation correctly, you have to set
TYPE_MAX_VALUE/TYPE_MIN_VALUE to the values for the base type.
However, GIGI uses these attributes for other things besides
passing data to the middle end, so it's not an easy change.


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