From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E32013870897; Thu, 14 May 2020 09:49:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E32013870897 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1589449796; bh=5S9/oCpy8xBVP7SEIKfta3n6QhJZQ54KfNnjGcxR0Uk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=kqgoAyp3ctrXjIW2x2zFfi4Fe2T6RIAht2W0an1EYabzRZDXBAWTIzilOqK97LYVj gRRNnQUPBVoHMhM8P/oWo9dojTqaC19iglbdDlTOtO2Bir/y7lG6bzUc/+9DIIYMH7 bC3eYvEA1L1JlKolHGsX91HhuXDWx9DUEXMc7sys= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/94703] Small-sized memcpy leading to unnecessary register spillage unless done through a dummy union Date: Thu, 14 May 2020 09:49:56 +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: 10.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: REOPENED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rguenth 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 09:49:57 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94703 --- Comment #13 from Richard Biener --- (In reply to ro@CeBiTec.Uni-Bielefeld.DE from comment #10) > > --- Comment #9 from Richard Biener --- > [...] > > Hmm, OK looks like memcpy is not folded, likely because the source is > > not known to be appropriately aligned. > [...] > > should fix this. Can you verify and if so, commit? Thx. >=20 > Unfortunately, it doesn't. OK, this only helps a bit later since CCP is required to propagate the alignment, the following forwprop pass to elide the memcpy and then finally the update-address-taken invocation in the _second_ CCP pass after inlining will have pr94703.c.093t.ccp2:No longer having address taken: r I've long pondered to remove the memcpy folding restriction for strict-align targets but never went through. I'll update the testcase to require /* { dg-require-effective-target non_strict_align } */=