From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B856938582BC; Fri, 23 Jun 2023 17:07:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B856938582BC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1687540052; bh=y/ttuJb2Wz28U+wOZmbM29m9Z8W46/Opk09a+WshKec=; h=From:To:Subject:Date:From; b=xOQYos/5/pZPCxcfAmYTQ4eUJ6KcpYwzhZlIdbTkk2AkmieDATeSHAS05H1wEBT6E Y75hYIt8TK4c+XsV0Lod7MdIudkGtZaag6omJ6+7JF2lZCrGCVIQ58lbdSaAk9rtzo QGLhZvXn5ygAkX00woSBdqSd3EREG1AhmusiJVGc= From: "hubicka at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/110379] New: Unnecessary copies after early opts Date: Fri, 23 Jun 2023 17:07:32 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 13.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: hubicka 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 bug_severity priority component assigned_to reporter target_milestone 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=3D110379 Bug ID: 110379 Summary: Unnecessary copies after early opts Product: gcc Version: 13.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: hubicka at gcc dot gnu.org Target Milestone: --- Following testcase: class a=20 { public: int b; }; void foo (class a *); class b: public a { int test(); }; int b::test() { foo (this); return 0; } produces: int b::test (struct b * const this) { struct a * _1; [local count: 1073741824]: _1 =3D &this_2(D)->D.2773; foo (_1); return 0; } I think it is equivalent to int b::test (struct b * const this) { [local count: 1073741824]: foo (this); return 0; } Which would save statement and confuse less ipa-sra and ipa-prop.=