This is the mail archive of the
mailing list for the GCC project.
Re: Ada subtypes and base types
On 03/30/06 07:24, Duncan Sands wrote:
> On Wednesday 29 March 2006 23:28, Tom Tromey wrote:
>> 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.
When I initially implemented VRP, I was adding assertions very early in
the compilation pipeline. This has the advantage of getting the SSA
form on assertions built "for free".
However, it has negative effects on passes that rely on equality
properties like copy-propagation, value numbering, etc. So, not only
you need to "fix" every pass to see through ASSERT_EXPRs, you pay a
compile time penalty for doing so.
My recommendation is to first try and use langhooks that you can then
query in the assert insertion phase in tree-vrp.c.
In fact, ISTR something along these lines that Anthony Green added as a
proof of concept sometime last year. Anthony? Do you remember what it was?