From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id AC5663858D3C; Mon, 14 Feb 2022 19:07:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AC5663858D3C From: "tnfchris at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/104529] [12 Regression] inefficient codegen around new/delete Date: Mon, 14 Feb 2022 19:07:00 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: tnfchris 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: short_desc bug_status resolution 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: Mon, 14 Feb 2022 19:07:00 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104529 Tamar Christina changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|[missed optimization] |[12 Regression] inefficient |inefficient codegen around |codegen around new/delete |new/delete | Status|RESOLVED |UNCONFIRMED Resolution|DUPLICATE |--- --- Comment #3 from Tamar Christina --- I'm re-opening because I don't think it has anything to do with #94294 This is a GCC 12 regression. In GCC 11 we generated in the mid-end [local count: 536870913]: _32 =3D operator new (6); MEM [(char * {ref-all})_32] =3D 255; MEM [(char * {ref-all})_32 + 4B] =3D 0; operator delete (_32, 6); return 56; and in GCC 12 we now generate [local count: 536870913]: MEM [(unsigned char *)&D.24688] =3D { 255, 0, 0= , 0 }; MEM [(unsigned char *)&D.24688 + 4B] =3D { 0, 0= }; _34 =3D operator new (6); MEM [(char * {ref-all})_34] =3D MEM [(char * {ref-all})&D.24688]; D.24688 =3D{v} {CLOBBER(eol)}; operator delete (_34, 6); return 56; See https://godbolt.org/z/KKfhxTxnd Forcing it to keep the stores before the call to new.=