[Bug tree-optimization/30911] VRP fails to eliminate range checks in Ada code

ebotcazou at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Tue Nov 17 11:19:00 GMT 2009



------- Comment #70 from ebotcazou at gcc dot gnu dot org  2009-11-17 11:19 -------
> It seems that variables produced by the Ada front-end no longer have any
> non-trivial range information associated with them.  Without knowing the
> range information
>    type S is range 0 .. 100;
>    type T is range 10 .. 20;
> it is impossible for the optimizers to eliminate most of the range checks
> in this testcase.  With the range information all of the checks can in theory
> be removed.  This is an example of how range information is potentially very
> helpful for optimizing Ada programs.

Theoretically, but this never really worked in practice; and experiments showed
that we get better code without it, especially in loops.

> Is there anyway for the optimizers to get at this range information still?
> Or was range information removed because it is essentially impossible to use
> it correctly (if so this bug report should be closed as unfixable)?

Yes, it's essentially impossible to use because of the need to support invalid
values.  There might be means to get the info back, e.g. using ASSERT_EXPRs,
but this hasn't been tried yet.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30911



More information about the Gcc-bugs mailing list