From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1B72F3893674; Sat, 25 Apr 2020 00:35:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1B72F3893674 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1587774912; bh=c3q8bQZcBj2uFGJvdQFehOfBbq1GCIDRy/rnRXMUaqg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=x2gUh0bMEWqvvEn4Pj/aXN8nME+Q0yP90gNbimTmeDCdqDGkubSSpo11fV3pGbt2I JKCVR3BYbcsrmt05MpqwQgar0bPdI2djVrweydVIxslNxPNsoi/ddo4ErG87XxN4xU FwPJDDpU/0Qk4Gox0nOM8StzSrvhqpfOE3xfgX3Q= From: "colomar.6.4.3 at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug analyzer/94754] -fanalyzer false positive due to it ignoring previous if Date: Sat, 25 Apr 2020 00:35:11 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: analyzer X-Bugzilla-Version: 10.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: colomar.6.4.3 at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: dmalcolm at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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: Sat, 25 Apr 2020 00:35:12 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94754 --- Comment #1 from Alejandro Colomar --- __builin_unreachable() helped silencing that specific bug, as a temporary workaround: [[gnu::nonnull]] static int init_x(int cond, int **x, int *y) { if (!cond) return -1; *x =3D y; return 0; } int foo(int cond) { int *x; int y =3D 7; if (cond < 2) return -1; /* cond >=3D 2 !=3D 0, so it will initialize x and return 0 */ if (init_x(cond, &x, &y)) __builtin_unreachable(); return *x; }=