Re: [Qemu-devel] [PATCH] configure: Always compile with -fwrapv

2016-09-13 Thread Peter Maydell
On 12 September 2016 at 18:06, Paolo Bonzini wrote: > > > On 12/09/2016 15:10, Peter Maydell wrote: >> QEMU's code relies on left shifts of signed integers always >> being defined behaviour with the obvious 2s-complement >> semantics. The only way to tell the compiler (and

Re: [Qemu-devel] [PATCH] configure: Always compile with -fwrapv

2016-09-12 Thread Paolo Bonzini
On 12/09/2016 15:10, Peter Maydell wrote: > QEMU's code relies on left shifts of signed integers always > being defined behaviour with the obvious 2s-complement > semantics. The only way to tell the compiler (and any > associated undefined-behaviour sanitizer) that we require a > C dialect with

Re: [Qemu-devel] [PATCH] configure: Always compile with -fwrapv

2016-09-12 Thread Peter Maydell
On 12 September 2016 at 16:04, Markus Armbruster wrote: > If I remember correctly, we discussed -fno-strict-overflow (which the > kernel uses), but in the end opted for the more stringent -fwrapv. Yep. -fno-strict-overflow just says "don't do bad things on integer overflow

Re: [Qemu-devel] [PATCH] configure: Always compile with -fwrapv

2016-09-12 Thread Markus Armbruster
Peter Maydell writes: > QEMU's code relies on left shifts of signed integers always > being defined behaviour with the obvious 2s-complement > semantics. The only way to tell the compiler (and any > associated undefined-behaviour sanitizer) that we require a > C dialect

[Qemu-devel] [PATCH] configure: Always compile with -fwrapv

2016-09-12 Thread Peter Maydell
QEMU's code relies on left shifts of signed integers always being defined behaviour with the obvious 2s-complement semantics. The only way to tell the compiler (and any associated undefined-behaviour sanitizer) that we require a C dialect with these semantics is to use the -fwrapv option. This is