Re: [PATCH][RFC] middle-end/46476 - resurrect -Wunreachable-code

2021-11-29 Thread Martin Sebor via Gcc-patches
On 11/25/21 12:57 AM, Richard Biener wrote: On Wed, 24 Nov 2021, Martin Sebor wrote: On 11/24/21 8:21 AM, Richard Biener via Gcc-patches wrote: This resurrects -Wunreachable-code and implements a warning for trivially unreachable code as of CFG construction. Most problematic with this is the

Re: [PATCH][RFC] middle-end/46476 - resurrect -Wunreachable-code

2021-11-25 Thread Richard Biener via Gcc-patches
On Thu, 25 Nov 2021, Michael Matz wrote: > Hello, > > On Thu, 25 Nov 2021, Richard Biener wrote: > > > > Yes, that's definitely the case - I was too lazy to re-use the old > > > option name here. But I don't have a good name at hand, maybe clang > > > has an option covering the cases I'm

Re: [PATCH][RFC] middle-end/46476 - resurrect -Wunreachable-code

2021-11-25 Thread Michael Matz via Gcc-patches
Hello, On Thu, 25 Nov 2021, Richard Biener wrote: > > Yes, that's definitely the case - I was too lazy to re-use the old > > option name here. But I don't have a good name at hand, maybe clang > > has an option covering the cases I'm thinking about. As you asked: I already have difficulties to

Re: [PATCH][RFC] middle-end/46476 - resurrect -Wunreachable-code

2021-11-25 Thread Richard Biener via Gcc-patches
On Thu, 25 Nov 2021, Richard Biener wrote: > On Wed, 24 Nov 2021, Jason Merrill wrote: > > > On 11/24/21 11:15, Marek Polacek wrote: > > > On Wed, Nov 24, 2021 at 04:21:31PM +0100, Richard Biener via Gcc-patches > > > wrote: > > >> This resurrects -Wunreachable-code and implements a warning for

Re: [PATCH][RFC] middle-end/46476 - resurrect -Wunreachable-code

2021-11-25 Thread Richard Biener via Gcc-patches
On Thu, 25 Nov 2021, Richard Biener wrote: > On Wed, 24 Nov 2021, Michael Matz wrote: > > > Hello, > > > > On Wed, 24 Nov 2021, Richard Biener wrote: > > > > > >> +/* Unreachable code in if (0) block. */ > > > >> +void baz(int *p) > > > >> +{ > > > >> + if (0) > > > >> + { > > > >> +

Re: [PATCH][RFC] middle-end/46476 - resurrect -Wunreachable-code

2021-11-25 Thread Richard Biener via Gcc-patches
On Wed, 24 Nov 2021, Michael Matz wrote: > Hello, > > On Wed, 24 Nov 2021, Richard Biener wrote: > > > >> +/* Unreachable code in if (0) block. */ > > >> +void baz(int *p) > > >> +{ > > >> + if (0) > > >> + { > > >> +return; /* { dg-bogus "not reachable" } */ > > > > > >Hmm?

Re: [PATCH][RFC] middle-end/46476 - resurrect -Wunreachable-code

2021-11-24 Thread Richard Biener via Gcc-patches
On Wed, 24 Nov 2021, Martin Sebor wrote: > On 11/24/21 8:21 AM, Richard Biener via Gcc-patches wrote: > > This resurrects -Wunreachable-code and implements a warning for > > trivially unreachable code as of CFG construction. Most problematic > > with this is the C/C++ frontend added 'return 0;'

Re: [PATCH][RFC] middle-end/46476 - resurrect -Wunreachable-code

2021-11-24 Thread Richard Biener via Gcc-patches
On Wed, 24 Nov 2021, Jason Merrill wrote: > On 11/24/21 11:15, Marek Polacek wrote: > > On Wed, Nov 24, 2021 at 04:21:31PM +0100, Richard Biener via Gcc-patches > > wrote: > >> This resurrects -Wunreachable-code and implements a warning for > >> trivially unreachable code as of CFG construction.

Re: [PATCH][RFC] middle-end/46476 - resurrect -Wunreachable-code

2021-11-24 Thread Jason Merrill via Gcc-patches
On 11/24/21 11:15, Marek Polacek wrote: On Wed, Nov 24, 2021 at 04:21:31PM +0100, Richard Biener via Gcc-patches wrote: This resurrects -Wunreachable-code and implements a warning for trivially unreachable code as of CFG construction. Most problematic with this is the C/C++ frontend added

Re: [PATCH][RFC] middle-end/46476 - resurrect -Wunreachable-code

2021-11-24 Thread Eric Gallager via Gcc-patches
On Wed, Nov 24, 2021 at 10:22 AM Richard Biener via Gcc-patches wrote: > > This resurrects -Wunreachable-code and implements a warning for > trivially unreachable code as of CFG construction. Most problematic > with this is the C/C++ frontend added 'return 0;' stmt in main > which the patch

Re: [PATCH][RFC] middle-end/46476 - resurrect -Wunreachable-code

2021-11-24 Thread Martin Sebor via Gcc-patches
On 11/24/21 8:21 AM, Richard Biener via Gcc-patches wrote: This resurrects -Wunreachable-code and implements a warning for trivially unreachable code as of CFG construction. Most problematic with this is the C/C++ frontend added 'return 0;' stmt in main which the patch handles for C++ like the

Re: [PATCH][RFC] middle-end/46476 - resurrect -Wunreachable-code

2021-11-24 Thread Michael Matz via Gcc-patches
Hello, On Wed, 24 Nov 2021, Richard Biener wrote: > >> +/* Unreachable code in if (0) block. */ > >> +void baz(int *p) > >> +{ > >> + if (0) > >> + { > >> +return; /* { dg-bogus "not reachable" } */ > > > >Hmm? Why are you explicitely saying that warning here would be bogus? >

Re: [PATCH][RFC] middle-end/46476 - resurrect -Wunreachable-code

2021-11-24 Thread Marek Polacek via Gcc-patches
On Wed, Nov 24, 2021 at 04:21:31PM +0100, Richard Biener via Gcc-patches wrote: > This resurrects -Wunreachable-code and implements a warning for > trivially unreachable code as of CFG construction. Most problematic > with this is the C/C++ frontend added 'return 0;' stmt in main > which the

Re: [PATCH][RFC] middle-end/46476 - resurrect -Wunreachable-code

2021-11-24 Thread Richard Biener via Gcc-patches
On November 24, 2021 4:43:45 PM GMT+01:00, Michael Matz wrote: >Hello, > >> +/* Unreachable code in if (0) block. */ >> +void baz(int *p) >> +{ >> + if (0) >> + { >> +return; /* { dg-bogus "not reachable" } */ > >Hmm? Why are you explicitely saying that warning here would be

Re: [PATCH][RFC] middle-end/46476 - resurrect -Wunreachable-code

2021-11-24 Thread Michael Matz via Gcc-patches
Hello, > +/* Unreachable code in if (0) block. */ > +void baz(int *p) > +{ > + if (0) > + { > +return; /* { dg-bogus "not reachable" } */ Hmm? Why are you explicitely saying that warning here would be bogus? It quite clearly _is_ unreachable, so warning there makes sense.