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: [RFC] optimize x - y cmp 0 with undefined overflow


> I'm asking to merge them (move them to fold_comparison).

OK, I'll repost a first patch doing only the fold-const.c massaging.

> Yeah, it would be nice to see some support.  The most interesting cases
> will be symbolic-singleton +- CST where the offset shrinks a constant offset
> in a symbolic A +- CST (thus we don't get into any overflow issues).  Thus
> handling
> 
>  [a + 1, a + 1] - [1, 1] -> [a, a]
> 
> for example.  We get the offsetted singleton symbolic ranges from
> conditional asserts a lot.

For the case at hand, you have [x + 1, INF] for y and you want to evaluate the 
range of y - x, so you really don't want to use the range of x...

-- 
Eric Botcazou


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