On Fri, 27 Feb 2009, Jay Foad wrote: > > To support languages that have undefined semantics on overflowing > > operations the middle-end gets new unary and binary operators > > that implicitly encode value-range information about their operands > > noting that the operation does not overflow. These does-not-overflow > > operators transform the undefined behavior into a valid assumption > > and thus make the GIMPLE IL fully defined. > > From an optimisation pass's point of view, what's the difference between: > > 1. a PLUS expression that gives an undefined result on overflow, and > 2. a PLUS expression with a guarantee that the result won't overflow. > > I can't see how they will be handled any differently in practice.
There is no difference in practice other than that we do a consistent interpretation of undefined. Note that the whole point of the branch is to make overflow behavior explicit per operation, not globally set per flag and for signed types only. Richard.