Re: [patch] Enable lightweight checks with _GLIBCXX_ASSERTIONS.

2015-09-28 Thread Florian Weimer
On 09/27/2015 12:24 PM, Jonathan Wakely wrote: > Doh, sorry, I meant this instead i.e. the non-recursive mutex. > +# if _GLIBCXX_ASSERTIONS && defined(PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP) > +// Use an error-checking mutex type when assertions are enabled. > +__native_type _M_mutex = P

Re: [patch] Enable lightweight checks with _GLIBCXX_ASSERTIONS.

2015-09-27 Thread Jonathan Wakely
On 26/09/15 22:49 +0200, Florian Weimer wrote: On 09/26/2015 09:52 PM, Jonathan Wakely wrote: Would changes like this be suitable for _FORTIFY_SOURCE? diff --git a/libstdc++-v3/include/std/mutex b/libstdc++-v3/include/std/mutex index 5e5ced1..074bf26 100644 --- a/libstdc++-v3/include/std/mut

Re: [patch] Enable lightweight checks with _GLIBCXX_ASSERTIONS.

2015-09-26 Thread Florian Weimer
On 09/26/2015 09:52 PM, Jonathan Wakely wrote: > Would changes like this be suitable for _FORTIFY_SOURCE? > diff --git a/libstdc++-v3/include/std/mutex b/libstdc++-v3/include/std/mutex > index 5e5ced1..074bf26 100644 > --- a/libstdc++-v3/include/std/mutex > +++ b/libstdc++-v3/include/std/mutex >

Re: [patch] Enable lightweight checks with _GLIBCXX_ASSERTIONS.

2015-09-26 Thread Jonathan Wakely
On 14/09/15 11:57 +0200, Florian Weimer wrote: On 09/10/2015 06:57 PM, Martin Sebor wrote: There is quite a bit of documentation of _FORTIFY_SOURCE that explains its effect on user code. I think there are only random blog articles discussing aspects of it, most of them slightly incorrect or o

Re: [patch] Enable lightweight checks with _GLIBCXX_ASSERTIONS.

2015-09-14 Thread Florian Weimer
On 09/10/2015 06:57 PM, Martin Sebor wrote: >>> There is quite a bit of documentation of _FORTIFY_SOURCE that explains >>> its effect on user code. >> >> I think there are only random blog articles discussing aspects of it, >> most of them slightly incorrect or outdated. > > _FORTIFY_SOURCE is a

Re: [patch] Enable lightweight checks with _GLIBCXX_ASSERTIONS.

2015-09-10 Thread Martin Sebor
On 09/10/2015 10:38 AM, Florian Weimer wrote: On 09/10/2015 06:30 PM, Martin Sebor wrote: On 09/09/2015 09:58 AM, Florian Weimer wrote: On 09/08/2015 05:45 PM, Jonathan Wakely wrote: I doubt we can achieve the complexity goals in all cases. I expect that for (int i = 0; i < 1; ++i) {

Re: [patch] Enable lightweight checks with _GLIBCXX_ASSERTIONS.

2015-09-10 Thread Florian Weimer
On 09/10/2015 06:30 PM, Martin Sebor wrote: > On 09/09/2015 09:58 AM, Florian Weimer wrote: >> On 09/08/2015 05:45 PM, Jonathan Wakely wrote: >> I doubt we can achieve the complexity goals in all cases. I expect that for (int i = 0; i < 1; ++i) { vector[i];

Re: [patch] Enable lightweight checks with _GLIBCXX_ASSERTIONS.

2015-09-10 Thread Martin Sebor
On 09/09/2015 09:58 AM, Florian Weimer wrote: On 09/08/2015 05:45 PM, Jonathan Wakely wrote: I doubt we can achieve the complexity goals in all cases. I expect that for (int i = 0; i < 1; ++i) { vector[i]; } is optimized away in default mode, but with _GLIBCXX_ASSERTIONS, it is n

Re: [patch] Enable lightweight checks with _GLIBCXX_ASSERTIONS.

2015-09-09 Thread Jonathan Wakely
On 09/09/15 14:54 +0100, Jonathan Wakely wrote: On 08/09/15 21:52 +0200, François Dumont wrote: Very good approach, I will start moving light checks from _GLIBCXX_DEBUG implementation to normal one then. Great, thanks. I *think* my patch got most of the lightweight checks already. We could ma

Re: [patch] Enable lightweight checks with _GLIBCXX_ASSERTIONS.

2015-09-09 Thread Florian Weimer
On 09/08/2015 05:45 PM, Jonathan Wakely wrote: >> I doubt we can achieve the complexity goals in all cases. I expect that >> >> for (int i = 0; i < 1; ++i) { >>vector[i]; >> } >> >> is optimized away in default mode, but with _GLIBCXX_ASSERTIONS, it is >> not. >> >> The last time I look

Re: [patch] Enable lightweight checks with _GLIBCXX_ASSERTIONS.

2015-09-09 Thread Jonathan Wakely
On 08/09/15 21:52 +0200, François Dumont wrote: Very good approach, I will start moving light checks from _GLIBCXX_DEBUG implementation to normal one then. Great, thanks. I *think* my patch got most of the lightweight checks already. We could maybe include the irreflexivity checks, although it

Re: [patch] Enable lightweight checks with _GLIBCXX_ASSERTIONS.

2015-09-08 Thread François Dumont
On 07/09/2015 20:27, Jonathan Wakely wrote: > This patch adds the "debug mode lite" we've been talking about, by > changing __glibcxx_assert to be activated by _GLIBCXX_ASSERTIONS > instead of _GLIBCXX_DEBUG (and making the latter imply the former). > > _GLIBCXX_ASSERTIONS is already used in Parall

Re: [patch] Enable lightweight checks with _GLIBCXX_ASSERTIONS.

2015-09-08 Thread Jonathan Wakely
On 08/09/15 17:00 +0200, Florian Weimer wrote: On 09/07/2015 09:59 PM, Jonathan Wakely wrote: On 07/09/15 21:31 +0200, Florian Weimer wrote: * Jonathan Wakely: This patch adds the "debug mode lite" we've been talking about, by changing __glibcxx_assert to be activated by _GLIBCXX_ASSERTIONS i

Re: [patch] Enable lightweight checks with _GLIBCXX_ASSERTIONS.

2015-09-08 Thread Florian Weimer
On 09/07/2015 09:59 PM, Jonathan Wakely wrote: > On 07/09/15 21:31 +0200, Florian Weimer wrote: >> * Jonathan Wakely: >> >>> This patch adds the "debug mode lite" we've been talking about, by >>> changing __glibcxx_assert to be activated by _GLIBCXX_ASSERTIONS >>> instead of _GLIBCXX_DEBUG (and mak

Re: [patch] Enable lightweight checks with _GLIBCXX_ASSERTIONS.

2015-09-08 Thread Jonathan Wakely
On 08/09/15 15:14 +0200, Michael Matz wrote: Hi, On Mon, 7 Sep 2015, Jonathan Wakely wrote: > Interesting. Is this mode ABI-compatible with the default mode? Yes, that's the main reason I want to make this change. > Should _FORTIFY_SOURCE imply _GLIBCXX_ASSERTIONS? Yes, I think it should.

Re: [patch] Enable lightweight checks with _GLIBCXX_ASSERTIONS.

2015-09-08 Thread Michael Matz
Hi, On Mon, 7 Sep 2015, Jonathan Wakely wrote: > > Interesting. Is this mode ABI-compatible with the default mode? > > Yes, that's the main reason I want to make this change. > > > Should _FORTIFY_SOURCE imply _GLIBCXX_ASSERTIONS? > > Yes, I think it should. Then at least those assertions th

Re: [patch] Enable lightweight checks with _GLIBCXX_ASSERTIONS.

2015-09-07 Thread Daniel Krügler
2015-09-07 22:10 GMT+02:00 Jonathan Wakely : > On 07/09/15 20:53 +0100, Jonathan Wakely wrote: >> On 07/09/15 21:04 +0200, Daniel Krügler wrote: >>> In the suggested doc changes: >>> >>> +When defined, _GLIBCXX_ASSERTIONS is defined >>> +automatically, so all the assertions that ena

Re: [patch] Enable lightweight checks with _GLIBCXX_ASSERTIONS.

2015-09-07 Thread Jonathan Wakely
On 07/09/15 20:53 +0100, Jonathan Wakely wrote: On 07/09/15 21:04 +0200, Daniel Krügler wrote: 2015-09-07 20:27 GMT+02:00 Jonathan Wakely : This patch adds the "debug mode lite" we've been talking about, by changing __glibcxx_assert to be activated by _GLIBCXX_ASSERTIONS instead of _GLIBCXX_DEB

Re: [patch] Enable lightweight checks with _GLIBCXX_ASSERTIONS.

2015-09-07 Thread Jonathan Wakely
On 07/09/15 21:31 +0200, Florian Weimer wrote: * Jonathan Wakely: This patch adds the "debug mode lite" we've been talking about, by changing __glibcxx_assert to be activated by _GLIBCXX_ASSERTIONS instead of _GLIBCXX_DEBUG (and making the latter imply the former). Interesting. Is this mode

Re: [patch] Enable lightweight checks with _GLIBCXX_ASSERTIONS.

2015-09-07 Thread Jonathan Wakely
On 07/09/15 21:04 +0200, Daniel Krügler wrote: 2015-09-07 20:27 GMT+02:00 Jonathan Wakely : This patch adds the "debug mode lite" we've been talking about, by changing __glibcxx_assert to be activated by _GLIBCXX_ASSERTIONS instead of _GLIBCXX_DEBUG (and making the latter imply the former). _GL

Re: [patch] Enable lightweight checks with _GLIBCXX_ASSERTIONS.

2015-09-07 Thread Florian Weimer
* Jonathan Wakely: > This patch adds the "debug mode lite" we've been talking about, by > changing __glibcxx_assert to be activated by _GLIBCXX_ASSERTIONS > instead of _GLIBCXX_DEBUG (and making the latter imply the former). Interesting. Is this mode ABI-compatible with the default mode? Should

Re: [patch] Enable lightweight checks with _GLIBCXX_ASSERTIONS.

2015-09-07 Thread Daniel Krügler
2015-09-07 20:27 GMT+02:00 Jonathan Wakely : > This patch adds the "debug mode lite" we've been talking about, by > changing __glibcxx_assert to be activated by _GLIBCXX_ASSERTIONS > instead of _GLIBCXX_DEBUG (and making the latter imply the former). > > _GLIBCXX_ASSERTIONS is already used in Paral

[patch] Enable lightweight checks with _GLIBCXX_ASSERTIONS.

2015-09-07 Thread Jonathan Wakely
This patch adds the "debug mode lite" we've been talking about, by changing __glibcxx_assert to be activated by _GLIBCXX_ASSERTIONS instead of _GLIBCXX_DEBUG (and making the latter imply the former). _GLIBCXX_ASSERTIONS is already used in Parallel Mode for enabling optional assertions (although s