From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8AA253858C52; Sat, 15 Oct 2022 01:08:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8AA253858C52 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1665796090; bh=A0C6Cy2GsBlTOYWT/dO0GyR9/sSwLOJ/odO6y7uNgLo=; h=From:To:Subject:Date:From; b=C0CwewUSC03YJLCTJwnjdYEC0KJJ5xcIp+tAozBUKdBej4gFdkDIw22rgEjnd0PZQ i9oBosDSn+EAT5q3WjsgwX7aORCGSSphZpwWGJWsZW/MqOUW2I6Tvhq6kRicbgRsTL YqhDUQH94ImF3nnByXxOqxPakVer01mnKQ/LxRMw= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/107270] New: [10/11/12/13 Regression] return for structure is not as good as before Date: Sat, 15 Oct 2022 01:08:10 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED 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: bug_id short_desc product version bug_status keywords bug_severity priority component assigned_to reporter target_milestone cf_gcctarget Message-ID: 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=3D107270 Bug ID: 107270 Summary: [10/11/12/13 Regression] return for structure is not as good as before Product: gcc Version: 12.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: normal Priority: P3 Component: rtl-optimization Assignee: unassigned at gcc dot gnu.org Reporter: pinskia at gcc dot gnu.org Target Milestone: --- Target: aarch64-*-* Take: ``` struct b { int t; int tt; }; union a { long long t; struct b b; }; struct b f(int i, int t) { return (struct b){i, t}; } long long f1(int i, int t) { struct b b =3D {i, t}; union a a; a.b =3D b; return a.t; } ``` In GCC 8.x, GCC -O2 would produce: ``` f: .cfi_startproc bfi x0, x1, 32, 32 ret f1: .cfi_startproc bfi x0, x1, 32, 32 ret ``` But in GCC 9 and above GCC produces: ``` f: .cfi_startproc uxtw x0, w0 orr x0, x0, x1, lsl 32 ret f1: .cfi_startproc uxtw x0, w0 orr x0, x0, x1, lsl 32 ret ```=