SOLVED: Problem with -fno-strict-overflow (was: Re: RFC: (Unconditionally) enable -fno-strict-overflow for kernel builds)

2013-12-19 Thread Stefan Esser
Am 30.11.2013 14:56, schrieb Konstantin Belousov: I propose to unconditionally add the switch -fno-strict-overflow to the kernel compilation. See the patch at the end of message for exact change proposed. What does it do. It disallows useless and counter-intuitive behaviour of the

Re: SOLVED: Problem with -fno-strict-overflow (was: Re: RFC: (Unconditionally) enable -fno-strict-overflow for kernel builds)

2013-12-19 Thread Oliver Pinter
On 12/19/13, Stefan Esser s...@freebsd.org wrote: Am 30.11.2013 14:56, schrieb Konstantin Belousov: I propose to unconditionally add the switch -fno-strict-overflow to the kernel compilation. See the patch at the end of message for exact change proposed. What does it do. It disallows

Re: SOLVED: Problem with -fno-strict-overflow (was: Re: RFC: (Unconditionally) enable -fno-strict-overflow for kernel builds)

2013-12-19 Thread Konstantin Belousov
On Thu, Dec 19, 2013 at 10:16:16AM +0100, Stefan Esser wrote: Am 30.11.2013 14:56, schrieb Konstantin Belousov: I propose to unconditionally add the switch -fno-strict-overflow to the kernel compilation. See the patch at the end of message for exact change proposed. What does it do.

Re: RFC: (Unconditionally) enable -fno-strict-overflow for kernel builds

2013-12-01 Thread dt71
Konstantin Belousov wrote, On 11/30/2013 13:56: The compiler authors take the undefined part there as a blanket to perform optimizations which are assuming that signed overflow cannot happen. Personally, when I first heard about such assumptions, it was inspiring to write code in a way that

Re: RFC: (Unconditionally) enable -fno-strict-overflow for kernel builds

2013-12-01 Thread Dimitry Andric
On 01 Dec 2013, at 01:33, Adrian Chadd adr...@freebsd.org wrote: On 30 November 2013 15:25, Dimitry Andric d...@freebsd.org wrote: ... Basically, if you rely on undefined behavior, you are inventing your own de facto language, which is *not* C. That is fine with me, but let's not pretend the

RFC: (Unconditionally) enable -fno-strict-overflow for kernel builds

2013-11-30 Thread Konstantin Belousov
I propose to unconditionally add the switch -fno-strict-overflow to the kernel compilation. See the patch at the end of message for exact change proposed. What does it do. It disallows useless and counter-intuitive behaviour of the compiler(s) for the signed overflow. Basically, the issue is

Re: RFC: (Unconditionally) enable -fno-strict-overflow for kernel builds

2013-11-30 Thread Adrian Chadd
+1, this caught us out with sendfile testing very recently :( -a On 30 November 2013 05:56, Konstantin Belousov kostik...@gmail.com wrote: I propose to unconditionally add the switch -fno-strict-overflow to the kernel compilation. See the patch at the end of message for exact change

Re: RFC: (Unconditionally) enable -fno-strict-overflow for kernel builds

2013-11-30 Thread Poul-Henning Kamp
In message caj-vmomc6cmuo__etm7x6w8hpg8mafl2stepdsz4jn0xn6m...@mail.gmail.com , Adrian Chadd writes: The compiler authors take the undefined part there as a blanket to perform optimizations which are assuming that signed overflow cannot happen. That's sufficient explanation for me to support

Re: RFC: (Unconditionally) enable -fno-strict-overflow for kernel builds

2013-11-30 Thread Dimitry Andric
On 30 Nov 2013, at 14:56, Konstantin Belousov kostik...@gmail.com wrote: I propose to unconditionally add the switch -fno-strict-overflow to the kernel compilation. See the patch at the end of message for exact change proposed. What does it do. It disallows useless and counter-intuitive

Re: RFC: (Unconditionally) enable -fno-strict-overflow for kernel builds

2013-11-30 Thread Adrian Chadd
On 30 November 2013 15:25, Dimitry Andric d...@freebsd.org wrote: On 30 Nov 2013, at 14:56, Konstantin Belousov kostik...@gmail.com wrote: I propose to unconditionally add the switch -fno-strict-overflow to the kernel compilation. See the patch at the end of message for exact change

Re: RFC: (Unconditionally) enable -fno-strict-overflow for kernel builds

2013-11-30 Thread dt71
Adrian Chadd wrote, On 12/01/2013 01:33: Are you able to have clang/llvm/gcc tell us where/when code is relying on undefined behaviour? So we can, like, fix them? Well, there's -ftrapv. ___ freebsd-current@freebsd.org mailing list

Re: RFC: (Unconditionally) enable -fno-strict-overflow for kernel builds

2013-11-30 Thread Peter Wemm
On Sat, Nov 30, 2013 at 4:33 PM, Adrian Chadd adr...@freebsd.org wrote: [..] Are you able to have clang/llvm/gcc tell us where/when code is relying on undefined behaviour? So we can, like, fix them? It wasn't all that long ago that we had this wonderful thing called -Werror and had a clean

Re: RFC: (Unconditionally) enable -fno-strict-overflow for kernel builds

2013-11-30 Thread Eitan Adler
On Sat, Nov 30, 2013 at 11:26 PM, Peter Wemm pe...@wemm.org wrote: On Sat, Nov 30, 2013 at 4:33 PM, Adrian Chadd adr...@freebsd.org wrote: [..] Are you able to have clang/llvm/gcc tell us where/when code is relying on undefined behaviour? So we can, like, fix them? It wasn't all that long

Re: RFC: (Unconditionally) enable -fno-strict-overflow for kernel builds

2013-11-30 Thread Peter Wemm
On Sat, Nov 30, 2013 at 8:38 PM, Eitan Adler li...@eitanadler.com wrote: On Sat, Nov 30, 2013 at 11:26 PM, Peter Wemm pe...@wemm.org wrote: On Sat, Nov 30, 2013 at 4:33 PM, Adrian Chadd adr...@freebsd.org wrote: [..] Are you able to have clang/llvm/gcc tell us where/when code is relying on

Re: RFC: (Unconditionally) enable -fno-strict-overflow for kernel builds

2013-11-30 Thread Konstantin Belousov
On Sat, Nov 30, 2013 at 04:33:17PM -0800, Adrian Chadd wrote: On 30 November 2013 15:25, Dimitry Andric d...@freebsd.org wrote: On 30 Nov 2013, at 14:56, Konstantin Belousov kostik...@gmail.com wrote: I propose to unconditionally add the switch -fno-strict-overflow to the kernel