This is the mail archive of the gcc-patches@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: [PATCH] Improve PR30911 and PR31023, Ada and VRP


On Mon, 31 Mar 2008, Duncan Sands wrote:

> Hi,
> 
> > So I see only harm in the current non-existing middle-end semantics
> > of integral sub-types.  Thus I recommend to disallow using them
> > for variables exposed to the middle-end.
> 
> I have to agree, it is all just too error prone.  How about having
> the Ada front-end add ASSERT_EXPR's (or maybe an equivalent builtin)
> at points where it knows an interesting bound?  Unlike the current
> situation, these should mean what they say: the value is guaranteed
> to be in the range.  As such they wouldn't apply to uninitialized
> variables and so forth, which would remove the need for a VRP barrier
> like VIEW_CONVERT_EXPR.

That would work and is IMHO the correct way to do it.  I wanted to
expose this to C assert() in -DNDEBUG mode as __builtin_assume()
for quite some time.  The easiest thing is to simply emit ASSERT_EXPRs
(though they will be removed after the first VRP pass, but that
probably doesn't matter too much).

Richard.


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