From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 909613937430; Fri, 13 Mar 2020 12:16:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 909613937430 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1584101785; bh=zclSnaAjGwTXSsEw9KUbc5YXIVwn++l7paQWqM420xk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=f2iiGtocP0A/wukLMvv7CRlrV6sT+wSoHxvGi8LuWX6JOCFN6ndQS0kZalVOgLsaj HvlRFpWyIK+S/GpcFeGLxjrbnd6Ye+6q6dr0XsbD2f9MOhEvhhSkj4/qPpqrxsorY8 I8oy0aH4ywhH6WxEBFtK2KkrPistTA/rLiM0vNDE= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug other/94165] Wrong "warning: this statement may fall through" after __builtin_unreachable(). Date: Fri, 13 Mar 2020 12:16:25 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: other X-Bugzilla-Version: 9.2.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Mar 2020 12:16:25 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94165 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #1 from Jakub Jelinek --- This warning is an early warning (during gimplification) and can handle only some constructs that clearly can't fall thru. E.g. we do warn for: extern void foo (const char *) __attribute__((noreturn)); int bar (int x) { switch (x) { default: foo ("bug"); x++; case 1: return x + 2; } } but if you take the unreachable code after the noreturn call, we won't warn. The expression statement is similar, there is code after the noreturn call. Finding noreturn stuff in the middle of sequences would be difficult and expensive. Only the cfg pass is then able to figure out that some code is unreachable.=