From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23781 invoked by alias); 27 Oct 2008 14:36:29 -0000 Received: (qmail 23501 invoked by uid 48); 27 Oct 2008 14:35:06 -0000 Date: Mon, 27 Oct 2008 14:36:00 -0000 Message-ID: <20081027143506.23499.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/36254] wrong "control reaches end of non-void function" warning In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "manu at gcc dot gnu dot org" 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: 2008-10/txt/msg01749.txt.bz2 ------- Comment #11 from manu at gcc dot gnu dot org 2008-10-27 14:35 ------- (In reply to comment #10) > Language specific tree codes are allowed until the gimplification is done, > the cp_gimplify_expr langhook takes care of either rewriting the lang specific > tree code into GENERIC (COND_EXPR in this case), or tuplifying it right away. If they are permitted, they should be handled. If they are not handled, we should fail to compile or crash. Currently we just ignore them, which works ok for C since generic is basically C but fails for everything else. > BTW, looking at the other testcase, block_may_fallthru certainly isn't able > to say whether a SWITCH_EXPR can fall thru or not, and it wouldn't be actually > very easy. So perhaps we either need to run some pass that kills obvious dead > code before reporting the "control reaches end" warnings, or really try harder > during gimplification to figure out these cases and optimize it at that point. So basically you propose to do optimizations at -O0. I still do not understand what is the problem with setting no_warning. This is *really* compiler-generated code. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36254