This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Bogus trees from Ada front-end (more VRP vs Ada) stuff)
- From: Laurent GUERBY <laurent at guerby dot net>
- To: law at redhat dot com
- Cc: Eric Botcazou <ebotcazou at adacore dot com>, gcc at gcc dot gnu dot org, kenner at vlsi1 dot ultra dot nyu dot edu
- Date: Tue, 07 Mar 2006 12:48:54 +0100
- Subject: Re: Bogus trees from Ada front-end (more VRP vs Ada) stuff)
- References: <200603041930.11024.ebotcazou@adacore.com> <1141578381.3033.3.camel@localhost.localdomain> <200603060031.38977.ebotcazou@adacore.com> <1141670346.2686.187.camel@localhost.localdomain>
On Mon, 2006-03-06 at 11:39 -0700, Jeffrey A Law wrote:
> if Side = Right or else Side = Both then
> while High >= Low and then Source (High) = Wide_Space loop
> High := High - 1;
> end loop;
> end if;
>
>
> side is an enumerated type with the following values
>
>
> Symbolic name Integer value
> left 0
> right 1
> both 2
>
> The min/max values associated with the type specify that side
> should have the values [0, 2].
>
> Note carefully that the expression (side - 1) will produce a value
> outside the defined min/max values for side's type [0, 2] when side
> has the value "left".
>
> Not surprisingly, we turn the .original code into this gimple code:
>
> D.5765 = side - 1;
> if (D.5765 <= 1)
Side is read-only in the code at the Ada level (an "in" parameter, so
considered constant in the function code), it's likely
that it's not the front-end that decided to generate "side - 1"
somewhere in the code but some combination of middle end transformations
not preserving type information correctly and then vrp-like
optimisations.
> I think it's time to hand this one to the Ada guys :-0
May be not :).
Laurent