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: Bogus trees from Ada front-end (more VRP vs Ada) stuff)


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


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