https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71031
--- Comment #8 from rguenther at suse dot de <rguenther at suse dot de> --- On Wed, 18 May 2016, mpolacek at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71031 > > Marek Polacek <mpolacek at gcc dot gnu.org> changed: > > What |Removed |Added > ---------------------------------------------------------------------------- > CC| |jakub at gcc dot gnu.org, > | |rguenth at gcc dot gnu.org > > --- Comment #7 from Marek Polacek <mpolacek at gcc dot gnu.org> --- > To expand a bit on Comment 4: we have [1, od_5] + UINT_MAX on type unsigned > and > are in extract_range_from_binary_expr_1. We combine the lower bounds, which > is > 1 + UINT_MAX = 0(OVF). We then combine the upper bounds, because the max_op0 > is not a constant, the result of that is UINT_MAX. So WMIN is 0(OVF) and WMAX > is UINT_MAX. These are equal to TYPE_MIN and TYPE_MAX, respectively. What to > do with that, drop to VR_VARYING if we have min overflow or max underflow? > > Richi/Jakub, any ideas? I'm kinda stuck here :(. The situation (+ UINT_MAX) is equal to [1, od_5] - 1 which would mean a result range of ideally [0, od_5 - 1]. I think Eric added this code so he may want to have a look here to see what general solution is appropriate. But yes, instead of asserting we can always drop to VR_VARYING ...