HackerTrans
TopNewTrendsCommentsPastAskShowJobs

lilllly

no profile record

comments

lilllly
·vor 4 Jahren·discuss
I can easily test if n+1 is < n with fwrapv.

Without you have to do convoluted things like rearranging the expression to unnatural forms (move the addition to the right but invert to subtraction, etc), special case INT_MAX/INT_MIN, and so on - which you then have to hope the compiler is smart enough to optimize, which it often isn't (oh how ironic).
lilllly
·vor 4 Jahren·discuss
We need a -fsane-c

Then they can add a #pragma optimize(assumes=no-int-overflow, whatever, etc) to precisely add optimizations when needed and you 'know' its safe.