qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PULL 2/9] QEMU does not care about left shifts of sign


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PULL 2/9] QEMU does not care about left shifts of signed negative values
Date: Wed, 25 Nov 2015 18:50:03 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0


On 25/11/2015 18:44, Peter Maydell wrote:
> > Ubsan also has warnings for undefined behavior of left shifts.  Checks for
> > left shift overflow and left shift of negative numbers, unfortunately,
> > cannot be silenced without also silencing the useful ones about out-of-range
> > shift amounts. -fwrapv ought to shut them up, but doesn't yet
> > (https://llvm.org/bugs/show_bug.cgi?id=25552; I am taking care of fixing
> > the same issues in GCC).  Luckily ubsan is optional, and the easy
> > workaround is to use -fsanitize-recover.
>
> We still haven't had any response from the LLVM/clang folks that
> this interpretation of the meaning of -fwrapv is their interpretation
> of it, have we? (I can't see any comments on the referenced bug.)

Reasonably, they will have to follow what GCC does, independent of
-fwrapv.  GCC has now promised to not exploit << undefined behavior,
even without -fwrapv.

So at this point, -fwrapv is only required to placate ubsan---which it
will do for GCC as soon as my other patch is approved (I talked on IRC
with one of the GCC-ubsan authors and he said he was okay).  clang with
ubsan remains broken, but that's no worse than before.

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]