From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D43BA3858C66; Sun, 8 Oct 2023 00:28:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D43BA3858C66 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1696724887; bh=LpcTplmBiiUjIszB9AvhT5YKfqjP/XQtRWFQWJx1fqM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=hKQCgccAH5dQNsyuOHn8W8ofaPwxhSk9hG2xcb7Jah8I4fejtTFNXUjzFQsjktpeN 6/QEeK8X8VvPMttg8TlOtkN2kIzrFRS7Et2OU9JECZOHFBiPG0ZEXBZX0YT3gx1Ho4 yKO6T7EmDWxfR3FFn+4kf3XHzS9NCbqNRx6gv4MM= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/111722] manually defined memcpy() and memmove() incorrectly handle overlap with -O2 -m32 -march=bdver2 Date: Sun, 08 Oct 2023 00:28:07 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 13.2.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: INVALID 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: bug_status resolution 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=3D111722 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Status|WAITING |RESOLVED Resolution|--- |INVALID --- Comment #4 from Andrew Pinski --- There is no bug here. ICF finds that your definition of memcpy is the same as memmove and merges = the 2 and then calls memcpy from your memmove and then inlines the normal memcpy because well it says it is the same. You can just use -fno-builtin to fix the issue by saying memcpy and memmove= are not builtins and treat them like normal functions. That fixes the issue by not inlining the target defined memcpy.=