From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C26FA38515D7; Fri, 23 Dec 2022 15:25:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C26FA38515D7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1671809118; bh=F73ZaIPjNg7HeFDubmXUHnvPJnTqhph9DhyMNckYjYY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=i/c6hHA1Lv0i0VHs5H3lkQxFLkwTIoBZ+cpkAeGAgo9eB8aFnlJjuos15HVhbEbno sXbGcABZ1bAhZZYx5MbOBV6ArRu4xMnFbEJem6rXcqx9HmqZYlaDuASZYjTN/un9LI 0YV4B901UcsXz5DUwBvNbrysFkkFLNqxfnNV0Fpc= From: "marxin at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug sanitizer/108085] gcc trunk's ASAN at -O3 missed a stack-use-after-scope Date: Fri, 23 Dec 2022 15:25:17 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: sanitizer X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: marxin at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: marxin at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: attachments.created 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=3D108085 --- Comment #3 from Martin Li=C5=A1ka --- Created attachment 54153 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D54153&action=3Dedit pr108085.c.216t.uncprop1.dot.svg So no, it's a real issue where we optimize out .ASAN_CHECK (6, &f, 4, 8); in the exit block. As seen in the dump file, we have the very ASAN_CHECK in bb= _3: .ASAN_CHECK (7, &f, 4, 8), however, there are 2 ASAN_MARK (POISON, &f, 4) c= alls that are on the path from bb_3 to the exit block. @Jakub: Can you please take a look at the optimization algorithm why the ch= eck is not preserved?=