[Bug ada/26797] [4.3 regression] ACATS cxh1001 fails

baldrick at free dot fr gcc-bugzilla@gcc.gnu.org
Tue Mar 13 10:30:00 GMT 2007



------- Comment #42 from baldrick at free dot fr  2007-03-13 10:30 -------
Subject: Re:  [4.3 regression] ACATS cxh1001 fails

> > It is not possible for a pointer value to be uninitialized.  The language
> > requires all pointers to be default initialized to null.
> 
> I mean the thing that pointer points to!

I think I now understand: I thought the problem we were discussing was
how to obtain correctness (which seems to be easy using local checks)
while in fact you were talking about how to optimize away unnecessary
validity checks (as compared to normal checks).  My current plan for
that in LLVM is to implement validity checks using a builtin_nop
intrinsic.  Multiple successive validity checks will be eliminated
as redundant because builtin_nop is a pure function.  That leaves
the question of how to teach the optimizers that an object is valid
in the various cases where the front-end for some reason knows this.
In such cases I'm thinking that you can issue an assert instruction
saying so, eg if type T has range 10..20 and at some point the front-end
knows that x (of type T) is valid, it can issue:
        assert(builtin_nop(x)>=10 && builtin_nop(x)<=20);
The dataflow and predicate analysis needed to exploit this can hopefully
be left to the optimizers, in particular to IPO (which LLVM is rather
good at).


-- 


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



More information about the Gcc-bugs mailing list