This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Ada subtypes and base types
On Wednesday 29 March 2006 23:28, Tom Tromey wrote:
> >>>>> "Duncan" == Duncan Sands <baldrick@free.fr> writes:
>
> Duncan> That still leaves the problem of how the Ada front-end tells the
> Duncan> middle-end that a variable is known to be in a certain range. Due
> Duncan> to the way the language works, the front-end often does know a useful
> Duncan> range, helpful for optimisation. If using types with strange ranges
> Duncan> is out, and ASSERT_EXPRs aren't appropriate, what is left?
>
> Yeah, there's got to be something.
>
> On irc today we were discussing handling 'this' in gcj. We can add an
> attribute to the argument to mark it as non-null... but strangely
> there doesn't seem to be a way to mark other local variables as
> known-non-null -- a curious deficiency.
If the front-end was allowed to place ASSERT_EXPRs in the trees it passes
to the middle-end, then you could place such assertions on the appropriate
local variables and voila. Jeff claimed that this would cause serious
problems for the copy propagation pass, but I don't see why.
All the best,
Duncan.