[PATCH] Document arithmetic overflow semantics

Roger Sayle roger@www.eyesopen.com
Thu Feb 13 18:06:00 GMT 2003


On Thu, 13 Feb 2003, Richard Henderson wrote:
> > I completely disagree, and so do GCC's patch reviewers.
>
> Huh?  I for one agree with Kenner.  Using the undefinedness of
> something to infer that it doesn't happen is well-established.

I apologise.  I'm sure I've had constant folding optimizations rejected
in the past for assuming overflow semantics.  At the time I posted this
claim, the "-A - B" patch that I was thinking off not only removed
overflows that occured in the original, but also introduces overflows
that didn't occur in the original.  I now realize that this is not
quite the same thing.

I'd previously had several floating point transformations rejected,
until I finally resolved the issue by introducing the flag_signaling_nans
option, that separated out the issues.  And today GCC's optimizers are
much improved for it.  Not that anyone used GCC with sNANs then or now,
but it helped appease the paranoia.

Roger
--



More information about the Gcc-patches mailing list