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 Tue, 1 Apr 2008, Richard Kenner wrote:

> > How would you communicate this to the middle-end then?
> 
> My rough proposal is the following: we add a flag to a VAR_DECL that
> means the value in it is invalid.  I think we also need a similar flag
> on the other two ways of making a value: INDIRECT_REF and FUNCTION_CALL.
> VRP propagates that flag the same way it propagates values with the fairly
> obvious propagation rules.  If that flag is clear for an expression, VRP
> uses the ranges from the subtype, otherwise from the type.
> 
> Then the Ada front-end is responsible for the initialization cases I spoke
> about and for setting this flag in the few statically-determinable cases
> where it needs to be set.

This looks equivalent to dropping sub-types (thus by default VRP would
only assume a value lies in the range of the "base-types") and at the
"few statically-determinable cases where it needs to be set" the Ada FE
would place ASSERT_EXPRs that assert the produced value is in the
range of the Ada sub-type.  VRP propagates that ranges with the fairly
obvious propagation rules then.

Richard.


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