This is the mail archive of the gcc-patches@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: [Ada] Avoid doing arithmetics in ENUMERAL_TYPE


On Thu, Apr 23, 2009 at 11:02 AM, Richard Guenther
<richard.guenther@gmail.com> wrote:
> On Thu, Apr 23, 2009 at 12:36 AM, Eric Botcazou <ebotcazou@adacore.com> wrote:
>> For
>>
>> ? ? [subtype p__T34b is p__enum range b .. c]
>> ? ? ?R45b : p__T34b := b;
>> ? ? ?R45b := p__T34b'succ(R45b);
>>
>> Gigi generates an additive expression in an enumeral type:
>>
>> ?R45b = (p__T34b___XDLU_1__2) ((p__enum) R45b + 1);
>>
>> and this is a no-no for non-standard precisions.
>
> At least if TYPE_MIN/MAX_VALUE does not cover all of
> TYPE_PRECISION. ?Otherwise the middle-end treats
> all integer types as exchangable.

Btw, this change seems to have fixed the type-verification issues
I ran into (and for which I added a kludge in the verifier - now removed).

Thanks!
Richard.


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