Re: [PATCH] c++: Implement -Wuninitialized for mem-initializers [PR19808]

2020-11-24 Thread Jason Merrill via Gcc-patches
On 11/20/20 6:08 PM, Martin Sebor wrote: On 11/19/20 11:41 AM, Jason Merrill wrote: On 11/17/20 3:44 AM, Jan Hubicka wrote: On Tue, Nov 17, 2020 at 01:33:48AM -0500, Jason Merrill via Gcc-patches wrote: Why doesn't the middle-end warning work for inline functions? It does but only when they'

Re: [PATCH] c++: Implement -Wuninitialized for mem-initializers [PR19808]

2020-11-20 Thread Martin Sebor via Gcc-patches
On 11/19/20 11:41 AM, Jason Merrill wrote: On 11/17/20 3:44 AM, Jan Hubicka wrote: On Tue, Nov 17, 2020 at 01:33:48AM -0500, Jason Merrill via Gcc-patches wrote: Why doesn't the middle-end warning work for inline functions? It does but only when they're called (and, as usual, also unless the

Re: [PATCH] c++: Implement -Wuninitialized for mem-initializers [PR19808]

2020-11-19 Thread Jason Merrill via Gcc-patches
On 11/17/20 3:44 AM, Jan Hubicka wrote: On Tue, Nov 17, 2020 at 01:33:48AM -0500, Jason Merrill via Gcc-patches wrote: Why doesn't the middle-end warning work for inline functions? It does but only when they're called (and, as usual, also unless the uninitialized use is eliminated). Yes, but

Re: [PATCH] c++: Implement -Wuninitialized for mem-initializers [PR19808]

2020-11-17 Thread Richard Biener
On Tue, 17 Nov 2020, Jan Hubicka wrote: > > On Tue, Nov 17, 2020 at 01:33:48AM -0500, Jason Merrill via Gcc-patches > > wrote: > > > > > Why doesn't the middle-end warning work for inline functions? > > > > > > > > It does but only when they're called (and, as usual, also unless > > > > the unin

Re: [PATCH] c++: Implement -Wuninitialized for mem-initializers [PR19808]

2020-11-17 Thread Jan Hubicka
> On Tue, Nov 17, 2020 at 09:44:26AM +0100, Jan Hubicka wrote: > > > I think for unused functions we don't even gimplify unused functions, the > > > cgraph code just throws them away. Even trying just to run the first few > > > passes (gimplification up to uninit1) would have several high costs, >

Re: [PATCH] c++: Implement -Wuninitialized for mem-initializers [PR19808]

2020-11-17 Thread Jakub Jelinek via Gcc-patches
On Tue, Nov 17, 2020 at 09:44:26AM +0100, Jan Hubicka wrote: > > I think for unused functions we don't even gimplify unused functions, the > > cgraph code just throws them away. Even trying just to run the first few > > passes (gimplification up to uninit1) would have several high costs, > Note th

Re: [PATCH] c++: Implement -Wuninitialized for mem-initializers [PR19808]

2020-11-17 Thread Jan Hubicka
> On Tue, Nov 17, 2020 at 01:33:48AM -0500, Jason Merrill via Gcc-patches wrote: > > > > Why doesn't the middle-end warning work for inline functions? > > > > > > It does but only when they're called (and, as usual, also unless > > > the uninitialized use is eliminated). > > > > Yes, but why? I

Re: [PATCH] c++: Implement -Wuninitialized for mem-initializers [PR19808]

2020-11-17 Thread Jakub Jelinek via Gcc-patches
On Tue, Nov 17, 2020 at 01:33:48AM -0500, Jason Merrill via Gcc-patches wrote: > > > Why doesn't the middle-end warning work for inline functions? > > > > It does but only when they're called (and, as usual, also unless > > the uninitialized use is eliminated). > > Yes, but why? I assume because

Re: [PATCH] c++: Implement -Wuninitialized for mem-initializers [PR19808]

2020-11-16 Thread Jason Merrill via Gcc-patches
On 11/16/20 10:13 PM, Martin Sebor wrote: On 11/16/20 12:02 PM, Jason Merrill wrote: On 11/16/20 12:42 PM, Martin Sebor wrote: On 11/15/20 3:44 PM, Marek Polacek via Gcc-patches wrote: This patch implements the long-desired -Wuninitialized warning for member initializer lists, so that the fron

Re: [PATCH] c++: Implement -Wuninitialized for mem-initializers [PR19808]

2020-11-16 Thread Martin Sebor via Gcc-patches
On 11/16/20 12:02 PM, Jason Merrill wrote: On 11/16/20 12:42 PM, Martin Sebor wrote: On 11/15/20 3:44 PM, Marek Polacek via Gcc-patches wrote: This patch implements the long-desired -Wuninitialized warning for member initializer lists, so that the front end can detect bugs like    struct A {  

Re: [PATCH] c++: Implement -Wuninitialized for mem-initializers [PR19808]

2020-11-16 Thread Jason Merrill via Gcc-patches
On 11/16/20 2:24 PM, Marek Polacek wrote: On Mon, Nov 16, 2020 at 02:02:00PM -0500, Jason Merrill via Gcc-patches wrote: On 11/16/20 12:42 PM, Martin Sebor wrote: On 11/15/20 3:44 PM, Marek Polacek via Gcc-patches wrote: This patch implements the long-desired -Wuninitialized warning for member

Re: [PATCH] c++: Implement -Wuninitialized for mem-initializers [PR19808]

2020-11-16 Thread Marek Polacek via Gcc-patches
On Mon, Nov 16, 2020 at 02:02:00PM -0500, Jason Merrill via Gcc-patches wrote: > On 11/16/20 12:42 PM, Martin Sebor wrote: > > On 11/15/20 3:44 PM, Marek Polacek via Gcc-patches wrote: > > > This patch implements the long-desired -Wuninitialized warning for > > > member initializer lists, so that t

Re: [PATCH] c++: Implement -Wuninitialized for mem-initializers [PR19808]

2020-11-16 Thread Jason Merrill via Gcc-patches
On 11/16/20 12:42 PM, Martin Sebor wrote: On 11/15/20 3:44 PM, Marek Polacek via Gcc-patches wrote: This patch implements the long-desired -Wuninitialized warning for member initializer lists, so that the front end can detect bugs like    struct A { int a; int b; A() : b(1), a(b)

Re: [PATCH] c++: Implement -Wuninitialized for mem-initializers [PR19808]

2020-11-16 Thread Martin Sebor via Gcc-patches
On 11/15/20 3:44 PM, Marek Polacek via Gcc-patches wrote: This patch implements the long-desired -Wuninitialized warning for member initializer lists, so that the front end can detect bugs like struct A { int a; int b; A() : b(1), a(b) { } }; where the field 'b' is used uni

[PATCH] c++: Implement -Wuninitialized for mem-initializers [PR19808]

2020-11-15 Thread Marek Polacek via Gcc-patches
This patch implements the long-desired -Wuninitialized warning for member initializer lists, so that the front end can detect bugs like struct A { int a; int b; A() : b(1), a(b) { } }; where the field 'b' is used uninitialized because the order of member initializers in the member