public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/110379] New: Unnecessary copies after early opts
@ 2023-06-23 17:07 hubicka at gcc dot gnu.org
  2023-06-23 19:54 ` [Bug middle-end/110379] " pinskia at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: hubicka at gcc dot gnu.org @ 2023-06-23 17:07 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110379

            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 
{
        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;

  <bb 2> [local count: 1073741824]:
  _1 = &this_2(D)->D.2773;
  foo (_1);
  return 0;
}

I think it is equivalent to


int b::test (struct b * const this)
{
  <bb 2> [local count: 1073741824]:
  foo (this);
  return 0;
}

Which would save statement and confuse less ipa-sra and ipa-prop.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-06-27  9:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-23 17:07 [Bug middle-end/110379] New: Unnecessary copies after early opts hubicka at gcc dot gnu.org
2023-06-23 19:54 ` [Bug middle-end/110379] " pinskia at gcc dot gnu.org
2023-06-23 19:57 ` pinskia at gcc dot gnu.org
2023-06-27  9:40 ` hubicka at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).