Tag: integer-overflow
-
Why is optimization forbidden if a C compiler cannot prove lack of UB?
10 If a C program has undefined behavior, anything can happen. Therefore compilers may assume that any given program does not contain UB. So, suppose our program contains the following: x += 5; /* Do something else without x in the meantime. */ x += 7; Of course, this can be optimized to /* Do…