This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] c++: Fix spurious fallthrough warning on break
- From: Siddhesh Poyarekar <siddhesh at sourceware dot org>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 20 Feb 2018 14:53:56 +0530
- Subject: Re: [PATCH] c++: Fix spurious fallthrough warning on break
- Authentication-results: sourceware.org; auth=none
- References: <20180219162900.31733-1-siddhesh@sourceware.org>
- Reply-to: siddhesh at sourceware dot org
On Monday 19 February 2018 09:59 PM, Siddhesh Poyarekar wrote:
> The C++ frontend generates a break that results in the fallthrough
> warning misfiring in nested switch blocks where cases in the inner
> switch block return, rendering the break pointless. The fallthrough
> detection in finish_break_stmt does not work either because the
> condition is encoded as an IF_STMT and not a COND_EXPR.
>
> Fix this by adding a condition for IF_STMT in the
> langhooks.block_may_fallthru for C++. Fix tested on x86_64. Full
> testsuite run is in progress.
Now confirmed that the patch does not introduce any new regressions.
Siddhesh