Signed integer overflow undefined behavior or not?
deadalnix via Digitalmars-d
digitalmars-d at puremagic.com
Thu Nov 12 23:59:00 PST 2015
On Friday, 13 November 2015 at 06:46:37 UTC, Ali Çehreli wrote:
> Since it's UB in C and C++, I've heard that both clang and gcc
> do remove code branches if they can prove that there will be
> signed overflow. I don't know how or whether that optimization
> is turned off for D.
>
> Ali
Clang does it, but LLVM IR defines flags for overflow behavior
and it is up to the frontend to choose which one it want to use.
More information about the Digitalmars-d
mailing list