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] Fix pr23046


On Sun, Sep 18, 2005 at 09:59:09PM -0400, Richard Kenner wrote:
> One other issue with option 3 is that we have to be very clear about what
> "doing bounds checks in a different type" means.  There has to be a way to
> indicate that these conversions are being done for the purpose of checks and
> that range information cannot be propagated through these conversion.

I'm inclined to think this would be an error already.  If type T has
bounds less than the precision, then there should never ever be a
variable of type T with a true value outside those bounds.  Which
means you should do all checking *before* you get to type T.

I don't know if that's practical or not though.  An alternate is to
emit a VIEW_CONVERT_EXPR for the conversion, and document that VRP
should not look through that expression.


r~


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