From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2FE7B3858C54; Tue, 28 Nov 2023 18:21:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2FE7B3858C54 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1701195663; bh=qMnr2ba4EigLCgV3ak+4ApBhjnpSId9KQMXWPMtQSbU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=E1/pWAoJplVgLieuoO4HGoGmPbxBucmX7zMqHt8f5amGRLT6czYHC9laaisaQ2lJK 6RmnB3tdy+sb5ghyNAruTHnmE2JUZNm7dBzN9+des55xaL8zBoHapN04koEXthPCsR oEGTf5Ew3GUJOTSccF7s8MZg0vQ+U12fx2Sh4FSg= From: "tavianator at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/112748] memmove(ptr, ptr, n) call optimized out even at -O0 with -fsanitize=undefined Date: Tue, 28 Nov 2023 18:21:03 +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-Version: 13.2.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: tavianator at gmail dot com 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: 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=3D112748 --- Comment #2 from Tavian Barnes --- (In reply to Andrew Pinski from comment #1) > Does -fsanitize=3Daddress remove it? Yes, it's still removed with -fsanitize=3Daddress. While ASAN is necessary to check that the memory is really allocated, UBSAN should at least check that ptr is not NULL. So it shouldn't be removed in either case.=