From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E5E0F3858C83; Thu, 2 Mar 2023 21:48:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E5E0F3858C83 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677793685; bh=lRH3HieTCEhNnr/iKvp68xOqgBgDUNppihwgcQ7hIj8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=gE56a2FEfujtbMMQHYWHfA5c5vgp4Iai36zuJxM5hm4DlLeIZhAdlCExbDJlPdrle qcyzAWCAbGF0IpJCu45046Bir/uWlVOekee7nDPhwi8VNegHYr98rPUN0hkQFNa+lD QPfQU8l9dtOGtSH+AaRygHDlUBsa6h/kKyWH4EH0= From: "dmalcolm at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug analyzer/108968] fanalyzer false positive with the uninitalised-ness of the stack pointer Date: Thu, 02 Mar 2023 21:48:05 +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: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: dmalcolm at gcc dot gnu.org X-Bugzilla-Status: WAITING 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108968 --- Comment #17 from David Malcolm --- ...where trunk emits: test.c:35:22: warning: dereference of NULL 'ptr' [CWE-476] [-Wanalyzer-null-dereference] 35 | ptr[0] =3D ~ptr[0]; | ~~~^~~ 'foo': events 1-6 | | 27 | char *ptr =3D ((void*)0); | | ^~~ | | | | | (1) 'ptr' is NULL | 28 |=20 | 29 | if ( ((get_cpu_info()->current_vcpu))->domain ) | | ~=20=20=20 | | | | | (2) following 'false' branch... |...... | 32 | asm volatile ("cmc"); | | ~~~=20=20=20=20 | | | | | (3) ...to here | 33 |=20 | 34 | if ( ((get_cpu_info()->current_vcpu))->domain ) | | ~=20=20=20 | | | | | (4) following 'true' branch... | 35 | ptr[0] =3D ~ptr[0]; | | ~~~~~~ | | | | | (5) ...to here | | (6) dereference of NULL 'ptr' |=