qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 for 2.5] QEMU does not care about left shifts


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH v2 for 2.5] QEMU does not care about left shifts of signed negative values
Date: Tue, 17 Nov 2015 18:45:34 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0


On 17/11/2015 18:39, Markus Armbruster wrote:
> The kernel switched from -fwrapv to -fno-strict-overflow in '09, because
> -fwrapv was buggy in gcc 4.1 (already old then, completely irrelevant
> now), and because it "seems to be much less disturbing to gcc too: the
> difference in the generated code by -fno-strict-overflow are smaller
> (compared to using neither flag) than when using -fwrapv", which may or
> may not be still the case with compilers that matter today.
> 
> Could you briefly explain why you picked -fwrapv and not
> -fno-strict-overflow?

Because -fno-strict-overflow doesn't silence ubsan, only -fwrapv does
(it doesn't silence it for negative left shifts, but I've asked on
gcc-patches whether they'd like to have that fixed as well).

In the meanwhile I got some good news from the GCC folks:

>> I think we should remove the ", but this is subject to change" in 
>> implement-c.texi (while replacing it with noting that ubsan will still 
>> diagnose such cases, and they will also be diagnosed where constant 
>> expressions are required).

Paolo



reply via email to

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