From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6372 invoked by alias); 21 Dec 2011 09:52:16 -0000 Received: (qmail 6359 invoked by uid 22791); 21 Dec 2011 09:52:15 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,SARE_HEAD_8BIT_SPAM,SARE_SUB_ENC_UTF8,TW_TM X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 21 Dec 2011 09:52:03 +0000 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/51644] [4.7 Regression] va_list vs. warning:=?UTF-8?Q?=20=E2=80=98noreturn=E2=80=99=20function=20does=20return=20is=20not=20fixable?= Date: Wed, 21 Dec 2011 09:53:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.7.0 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: 2011-12/txt/msg02328.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51644 --- Comment #2 from Jakub Jelinek 2011-12-21 09:51:45 UTC --- Caused by r181172 aka TREE_CLOBBER_P. The problem is that we have before *.cfg: __builtin_va_start (&args, 0); b (s, &args); __builtin_va_end (&args); finally_tmp.0 = 1; : args = {CLOBBER}; switch (finally_tmp.0) , default: , case 1: > : goto ; : return; : finally_tmp.0 = 0; goto ; : resx 1 and *.cfg pass obviously optimizes away anything after the noreturn call: : __builtin_va_start (&args, 0); b (s, &args); : return; : finally_tmp.0 = 0; args = {CLOBBER}; switch (finally_tmp.0) , case 1: > : resx 1 but the warn_function_return pass is immediately after that (and, this is -O0 anyway), so nothing optimizes the switch away into simple fall through into the resx 1 block. At -O and above we don't warn, because the *.eh pass before *.cfg pass optimizes this. So, IMHO to fix this, we need to do 2 things: 1) in decide_copy_try_finally reconsider if (!optimize) return ndests == 1; if finally contains only gimple_clobber_p stmts 2) estimate_num_insns should return 0 for gimple_clobber_p stmts