From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19873 invoked by alias); 20 Nov 2012 16:03:12 -0000 Received: (qmail 18794 invoked by uid 48); 20 Nov 2012 16:02:37 -0000 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/54046] [4.6/4.7/4.8 Regression] wrong control reaches end of non-void function for switch case with throw and default Date: Tue, 20 Nov 2012 16:03:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.6.4 X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-11/txt/msg01936.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54046 --- Comment #5 from Jakub Jelinek 2012-11-20 16:02:33 UTC --- I don't see how. The thing is, e.g. lower_stmt resets data->cannot_fallthru on most of the statements, even if it got changed to reset it only on GIMPLE_LABELs (or few selected others), such that say a noreturn call which sets data->cannot_fallthru followed by assignment or another call would keep cannot_fallthru set even when it is currently cleared, on GIMPLE_LABELs we'd need to reset anyway, as we don't have the CFG yet and don't have info how many gotos or other control transfer stmts to each GIMPLE_LABEL there are (and the values of cannot_fallthru at those points). So even just the break; after the __cxa_throw which got gimplified into goto ; : would reset cannot_fallthru. And the gimplifier doesn't see break; but already the goto