Re: [PATCH][C] Fixup pointer-int-sum

2011-07-07 Thread Richard Guenther
On Thu, 7 Jul 2011, Joseph S. Myers wrote: > On Thu, 7 Jul 2011, Richard Guenther wrote: > > > not overflow (what is actually the C semantics - is the > > multiplication allowed to overflow for unsigned intop? If not > > Overflow is not allowed. Formally the multiplication is as-if to infinite

Re: [PATCH][C] Fixup pointer-int-sum

2011-07-07 Thread Joseph S. Myers
On Thu, 7 Jul 2011, Richard Guenther wrote: > not overflow (what is actually the C semantics - is the > multiplication allowed to overflow for unsigned intop? If not Overflow is not allowed. Formally the multiplication is as-if to infinite precision, and then there is undefined behavior if the

[PATCH][C] Fixup pointer-int-sum

2011-07-07 Thread Richard Guenther
This tries to make sense of the comments and code in the code doing the index - size multiplication in pointer-int-sum. It also fixes a bogus integer-constant conversion which results in not properly canonicalized integer constants. The comment in the code claims the index - size multiplication