From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id F10963858C2D; Tue, 27 Sep 2022 13:18:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F10963858C2D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664284697; bh=TLfhizliQZAE5VGCE42mfEvUJWsWgEwTcJ3SRcmkOfw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=mj16KxE/GIs86Bul5iqxoi1eM4Rsofi48YMOjCTMYhHaiySu40vqc0ibgsibpa4Li cNrGZ6yI+PuSCUU4/tPblU3lpwgXTXoT4GnCepQW04+zmU/hse83Mgqy/WKkbeCO30 H7AykcAx/1IaiYWrKO20KyiODcys0uCzEyGgShrA= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/107051] redundant loads when copying a union Date: Tue, 27 Sep 2022 13:18:17 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 12.1.0 X-Bugzilla-Keywords: 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: cf_reconfirmed_on everconfirmed bug_status 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=3D107051 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2022-09-27 Ever confirmed|0 |1 Status|UNCONFIRMED |NEW --- Comment #1 from Richard Biener --- With -O2 I see func_1: .LFB0: .cfi_startproc movl e(%rip), %eax testl %eax, %eax je .L2 .L3: jmp .L3 .p2align 4,,10 .p2align 3 .L2: movq g_284+8(%rip), %rax movq %rax, g_284(%rip) ret note that with -O1 we retain c =3D g_284[1]; c$f0_3 =3D g_284[1].f0; c.f0 =3D c$f0_3; g_284[0] =3D c; after GIMPLE optimization which possibly explains this compared to c =3D g_284[1]; g_284[0] =3D c; with -O2.=