Do we abuse the "nsw" flag

Hi, There:

    Clang fails to compile @ CPU2000int suite. The symptom is that executable fail to run
with reference input.

    The root cause is that the compiler mistakenly optimizes expr "x * y / y" into x where the x*y is blindly
flagged with nsw without any analysis.

     The preproceeded code is excerpted bellow:

cat -n integer.i

This has come up before, and we just added -fwrapv to work around the problem:

Are you compiling without -fwrapv?


Signed arithmetic overflow is undefined in C and C++.

- David

It works like a charm! Thanks a lot!