From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4BACF385801D; Thu, 4 Jan 2024 13:37:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4BACF385801D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1704375477; bh=EfaZS737L2Ce158Sy37G4uk4pG869tV2gVX0VKg59so=; h=From:To:Subject:Date:In-Reply-To:References:From; b=xueFteSajWEQeZzKNzkId4wn6xVGi9FJVHKo6XLvtYhPo3ehqtn+1Ob3++aoA/GIa QfwQsqw/+Mkza+y4G7EG84MzoFY4u6mOYC0zwNAmsCxfo/Sttto92aHg6Oo1PH51PH 0uxQjVGIX2DW5aiXuX6OoByIwLecdIvzJ4e6jKoI= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/32667] block copy with exact overlap is expanded as memcpy Date: Thu, 04 Jan 2024 13:37:55 +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: 4.2.0 X-Bugzilla-Keywords: documentation, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW 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=3D32667 --- Comment #58 from Jakub Jelinek --- (In reply to Rich Felker from comment #57) > and more concerned about the consequences of LTO/whole-program-analysis w= here > something in the translation process can see the violated restrict > qualifier, infer UB, and blow everything up. That can't happen, in GCC in GIMPLE these are represented as assignments, n= ot {__builtin_,}memcpy calls and are turned into the calls (or inline expansio= n of the copying) only when being expanded into RTL. All the LTO/whole program optimizations happen on GIMPLE, so at that point nothing can be inferred from that because it simply isn't present in the IL= and only after all LTO & IPA optimizations are done individual functions go thr= ough the rest of GIMPLE optimizations and then RTL ones. The only exception to that is IPA-RA, which intra partition (for LTO, other= wise within the TU) can take into account what hard registers are used/unused by previously emitted functions and take that knowledge into their callers emitted later; but for those this is a library call like any other.=