Re: vector _M_start and 0 offset

2018-10-01 Thread Jonathan Wakely
On 29/09/18 10:56 +0200, Marc Glisse wrote: Hello, here is a clang-friendly version of the patch (same changelog), tested a while ago. Is it ok or do you prefer something like the + if(this->_M_impl._M_start._M_offset != 0) __builtin_unreachable(); version suggested by François? I don't th

Re: vector _M_start and 0 offset

2018-09-29 Thread Marc Glisse
Hello, here is a clang-friendly version of the patch (same changelog), tested a while ago. Is it ok or do you prefer something like the + if(this->_M_impl._M_start._M_offset != 0) __builtin_unreachable(); version suggested by François? -- Marc GlisseIndex: include/bits/stl_bvector.h

Re: vector _M_start and 0 offset

2018-09-17 Thread Marc Glisse
On Mon, 17 Sep 2018, Jonathan Wakely wrote: On 17/09/18 21:24 +0200, Marc Glisse wrote: On Mon, 17 Sep 2018, Marc Glisse wrote: On Mon, 17 Sep 2018, Jonathan Wakely wrote: Do other compilers besides gcc suppress the same way? No, clang doesn't: What version is that? I didn't test on thi

Re: vector _M_start and 0 offset

2018-09-17 Thread Jonathan Wakely
On 17/09/18 21:24 +0200, Marc Glisse wrote: On Mon, 17 Sep 2018, Marc Glisse wrote: On Mon, 17 Sep 2018, Jonathan Wakely wrote: Do other compilers besides gcc suppress the same way? No, clang doesn't: What version is that? I didn't test on this exact patch, but clang 6 and 7 print, for si

Re: vector _M_start and 0 offset

2018-09-17 Thread Jonathan Wakely
On 17/09/18 21:18 +0200, Marc Glisse wrote: On Mon, 17 Sep 2018, Jonathan Wakely wrote: Do other compilers besides gcc suppress the same way? No, clang doesn't: What version is that? I didn't test on this exact patch, but clang 6 and 7 print, for similar code: warning: generalized initiali

Re: vector _M_start and 0 offset

2018-09-17 Thread Marc Glisse
On Mon, 17 Sep 2018, Marc Glisse wrote: On Mon, 17 Sep 2018, Jonathan Wakely wrote: Do other compilers besides gcc suppress the same way? No, clang doesn't: What version is that? I didn't test on this exact patch, but clang 6 and 7 print, for similar code: warning: generalized initializer

Re: vector _M_start and 0 offset

2018-09-17 Thread Marc Glisse
On Mon, 17 Sep 2018, Jonathan Wakely wrote: Do other compilers besides gcc suppress the same way? No, clang doesn't: What version is that? I didn't test on this exact patch, but clang 6 and 7 print, for similar code: warning: generalized initializer lists are a C++11 extension [-Wc++1

Re: vector _M_start and 0 offset

2018-09-17 Thread Jonathan Wakely
On 17/09/18 20:10 +0100, Jonathan Wakely wrote: On 17/09/18 21:55 +0300, Ville Voutilainen wrote: On Mon, 17 Sep 2018 at 21:50, Jonathan Wakely wrote: "I used C++11 syntax because I find it nicer, and the compiler accepts it in C++98 mode with just a warning, suppressed in a standard header."

Re: vector _M_start and 0 offset

2018-09-17 Thread Jonathan Wakely
On 17/09/18 21:55 +0300, Ville Voutilainen wrote: On Mon, 17 Sep 2018 at 21:50, Jonathan Wakely wrote: >"I used C++11 syntax because I find it nicer, and the compiler accepts >it in C++98 mode with just a warning, suppressed in a standard >header." Oh sorry, I just looked at the patch and repl

Re: vector _M_start and 0 offset

2018-09-17 Thread Ville Voutilainen
On Mon, 17 Sep 2018 at 21:50, Jonathan Wakely wrote: >"I used C++11 syntax because I find it nicer, and the compiler accepts > >it in C++98 mode with just a warning, suppressed in a standard > >header." > > Oh sorry, I just looked at the patch and replied without reading the > top bit. > > >Even

Re: vector _M_start and 0 offset

2018-09-17 Thread Jonathan Wakely
On 17/09/18 19:57 +0200, Marc Glisse wrote: On Mon, 17 Sep 2018, Jonathan Wakely wrote: On 15/09/18 14:27 +0200, Marc Glisse wrote: Hello, as explained in the PR, the implementation of vector is weirdly wasteful. Preserving the ABI prevents from changing much for now, but this small tweak c

Re: vector _M_start and 0 offset

2018-09-17 Thread Marc Glisse
On Mon, 17 Sep 2018, Jonathan Wakely wrote: On 15/09/18 14:27 +0200, Marc Glisse wrote: Hello, as explained in the PR, the implementation of vector is weirdly wasteful. Preserving the ABI prevents from changing much for now, but this small tweak can help the compiler remove quite a bit of de

Re: vector _M_start and 0 offset

2018-09-17 Thread Jonathan Wakely
On 15/09/18 14:27 +0200, Marc Glisse wrote: Hello, as explained in the PR, the implementation of vector is weirdly wasteful. Preserving the ABI prevents from changing much for now, but this small tweak can help the compiler remove quite a bit of dead code. I think most other direct uses of

vector _M_start and 0 offset

2018-09-15 Thread Marc Glisse
Hello, as explained in the PR, the implementation of vector is weirdly wasteful. Preserving the ABI prevents from changing much for now, but this small tweak can help the compiler remove quite a bit of dead code. I think most other direct uses of _M_start are in constructors where the offset