Richard Biener <rguent...@suse.de> writes: > The issue in the PR the change is fixing is that we end up with > an expression that overflows but uses signed arithmetic and so > we miscompile it later. IIRC the fixes to split_constant_offset > always were that the sum of the base + offset wasn't equal to > the original expression, right?
Yeah, that's right. (sizetype)(INT_MIN - foo) was split into (sizetype)INT_MIN + (sizetype)(-foo), and so we ended up with ((sizetype)INT_MIN)*2 rather than 0 for foo==INT_MIN. Unfortunately, it looks like a lot of the discussion happened on irc (my fault) and I didn't keep logs. Thanks, Richard