[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH for 2.5] QEMU does not care about left shifts of
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH for 2.5] QEMU does not care about left shifts of signed negative values |
Date: |
Tue, 17 Nov 2015 13:10:36 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
On 17/11/2015 12:22, Peter Maydell wrote:
> On 17 November 2015 at 10:57, Paolo Bonzini <address@hidden> wrote:
>>
>>
>> On 17/11/2015 11:55, Peter Maydell wrote:
>>> If you pass clang -fwrapv then this causes -fsanitize=undefined to
>>> no longer complain about signed integer overflows from addition.
>>> However the sanitizer will still complain about left shifts of
>>> negative values. The conclusion I draw is that clang (as per
>>> the documentation) applies fwrapv only to addition &c, not to
>>> shifts.
>>
>> Ok, I'll open a bug for this. It's probably unintended, they've already
>> fixed -fwrapv once for pointers.
>
> Thanks. Other things that would need to be fixed for -fwrapv to
> apply to shifts:
> * gcc need to document this (this is a stronger statement than
> what they currently have since it is a guarantee not to change
> the semantics in the future if -fwrapv is set)
Actually they document it under -fstrict-overflow ("Using '-fwrapv'
means that integer signed overflow is fully defined: it wraps") but it
would be nice to add it under -fwrapv as well. I'll send a patch.
> * clang need to document this
> * -fwrapv in clang should suppress -Wshift-negative-value
> * ideally, test cases in both the clang and gcc test suites to
> defend the 2s-complement signed shift semantics
This + the ubsan issue is now https://llvm.org/bugs/show_bug.cgi?id=25552
Paolo
- [Qemu-devel] [PATCH for 2.5] QEMU does not care about left shifts of signed negative values, Paolo Bonzini, 2015/11/17
- Re: [Qemu-devel] [PATCH for 2.5] QEMU does not care about left shifts of signed negative values, Peter Maydell, 2015/11/17
- Re: [Qemu-devel] [PATCH for 2.5] QEMU does not care about left shifts of signed negative values, Paolo Bonzini, 2015/11/17
- Re: [Qemu-devel] [PATCH for 2.5] QEMU does not care about left shifts of signed negative values, Peter Maydell, 2015/11/17
- Re: [Qemu-devel] [PATCH for 2.5] QEMU does not care about left shifts of signed negative values, Paolo Bonzini, 2015/11/17
- Re: [Qemu-devel] [PATCH for 2.5] QEMU does not care about left shifts of signed negative values, Peter Maydell, 2015/11/17
- Re: [Qemu-devel] [PATCH for 2.5] QEMU does not care about left shifts of signed negative values, Peter Maydell, 2015/11/17
- Re: [Qemu-devel] [PATCH for 2.5] QEMU does not care about left shifts of signed negative values, Paolo Bonzini, 2015/11/17
- Re: [Qemu-devel] [PATCH for 2.5] QEMU does not care about left shifts of signed negative values, Peter Maydell, 2015/11/17
- Re: [Qemu-devel] [PATCH for 2.5] QEMU does not care about left shifts of signed negative values,
Paolo Bonzini <=
- Re: [Qemu-devel] [PATCH for 2.5] QEMU does not care about left shifts of signed negative values, Peter Maydell, 2015/11/17
- Re: [Qemu-devel] [PATCH for 2.5] QEMU does not care about left shifts of signed negative values, Laszlo Ersek, 2015/11/17
- Re: [Qemu-devel] [PATCH for 2.5] QEMU does not care about left shifts of signed negative values, Paolo Bonzini, 2015/11/17
- Re: [Qemu-devel] [PATCH for 2.5] QEMU does not care about left shifts of signed negative values, Laszlo Ersek, 2015/11/17
- Re: [Qemu-devel] [PATCH for 2.5] QEMU does not care about left shifts of signed negative values, Markus Armbruster, 2015/11/17
- Re: [Qemu-devel] [PATCH for 2.5] QEMU does not care about left shifts of signed negative values, Peter Maydell, 2015/11/17
- Re: [Qemu-devel] [PATCH for 2.5] QEMU does not care about left shifts of signed negative values, Laszlo Ersek, 2015/11/17
- Re: [Qemu-devel] [PATCH for 2.5] QEMU does not care about left shifts of signed negative values, Paolo Bonzini, 2015/11/17
- Re: [Qemu-devel] [PATCH for 2.5] QEMU does not care about left shifts of signed negative values, Laszlo Ersek, 2015/11/17
Re: [Qemu-devel] [PATCH for 2.5] QEMU does not care about left shifts of signed negative values, Markus Armbruster, 2015/11/17