From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1F2123858D32; Fri, 14 Apr 2023 08:12:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1F2123858D32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1681459977; bh=mFi9iZxrvIbKzRj7eeN1Yj68ZTHF1Rzl4CcImypps00=; h=From:To:Subject:Date:In-Reply-To:References:From; b=bjoEwXGferATQJERLRVxVV2xggDVkkwMDtNEoKoT8uHTDvb8AdJbFfrHNbNfJkDn2 9Q7w9fsTnyYhOZsYt/d4KboprY+AbYrQwYMFpQd3vYJ2XTJA+q6R+kuV8HUJnFIQrQ j1zIHz9YGQCOQTiIK5ftc97Bq0NIkKiuckmFIdy8= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/109495] Stack is used (unexpectedly) for copying on-heap objects (no problem in clang) Date: Fri, 14 Apr 2023 08:12:53 +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.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth 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: 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=3D109495 --- Comment #7 from Richard Biener --- Created attachment 54857 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D54857&action=3Dedit patch I have tested the attached successfully. Can you think of a case where we'd have a BLKmode target but a same size component ref source that has not? We could also check the components mode (but emulating what get_inner_reference does is tricky - but it might be useful to split the head of it out). In any case if the concern is just padding it's odd that we have to massage the _source_. And if we have to, for larger sizes we could at least block-copy the large head and just deal with the tail covering the padding with a temporary.=