Re: [PATCH] Avoid some C++ local statics with constructors

2016-09-23 Thread Richard Biener
On Fri, 23 Sep 2016, Richard Biener wrote: > On Thu, 22 Sep 2016, Jakub Jelinek wrote: > > > Hi! > > > > The discovered 5 unnecessary C++ static locals with ctors prompted me to > > look at other cases, which from looking at the optimized or non-optimized > > code are just terrible. > > We don't

Re: [PATCH] Avoid some C++ local statics with constructors

2016-09-23 Thread Jakub Jelinek
On Fri, Sep 23, 2016 at 10:59:12AM +0200, Richard Biener wrote: > On Fri, 23 Sep 2016, Jakub Jelinek wrote: > > > On Fri, Sep 23, 2016 at 08:55:02AM +0200, Richard Biener wrote: > > > While I agree with the goal to reduce the number of static constructors > > > esp. the vNULL cases I disagree with

Re: [PATCH] Avoid some C++ local statics with constructors

2016-09-23 Thread Richard Biener
On Fri, 23 Sep 2016, Jakub Jelinek wrote: > On Fri, Sep 23, 2016 at 08:55:02AM +0200, Richard Biener wrote: > > While I agree with the goal to reduce the number of static constructors > > esp. the vNULL cases I disagree with. This is just introducing > > undefined behavior (uninitialized object u

Re: [PATCH] Avoid some C++ local statics with constructors

2016-09-23 Thread Jakub Jelinek
On Fri, Sep 23, 2016 at 08:55:02AM +0200, Richard Biener wrote: > While I agree with the goal to reduce the number of static constructors > esp. the vNULL cases I disagree with. This is just introducing > undefined behavior (uninitialized object use), and in case we end up > making vNULL not all-z

Re: [PATCH] Avoid some C++ local statics with constructors

2016-09-22 Thread Richard Biener
On Thu, 22 Sep 2016, Jakub Jelinek wrote: > Hi! > > The discovered 5 unnecessary C++ static locals with ctors prompted me to > look at other cases, which from looking at the optimized or non-optimized > code are just terrible. > We don't need to initialize static vectors with vNULL, because that