[llvm-dev] Unsigned int displaying as negative

Tim Northover via llvm-dev llvm-dev at lists.llvm.org
Thu Feb 16 11:42:17 PST 2017


On 16 February 2017 at 11:35, Jonas Maebe via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> On 16/02/17 20:23, Tim Northover via llvm-dev wrote:
> Surely "signed overflow" does not result in undefined behaviour in LLVM IR
> unless nsw is specified?

That's right, without "nsw" signed overflow is irrelevant and LLVM's
2s-complement assumption kicks in: "add i32 0xffffffff, 1" == 0.

Cheers.

Tim.


More information about the llvm-dev mailing list