public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "tnfchris at gcc dot gnu.org" <gcc-bugzilla@gcc.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	[thread overview]
Message-ID: <bug-104529-4-H9pV0cf1Zv@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-104529-4@http.gcc.gnu.org/bugzilla/>

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

Tamar Christina <tnfchris at gcc dot gnu.org> 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 <tnfchris at gcc dot gnu.org> ---
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

  <bb 2> [local count: 536870913]:
  _32 = operator new (6);
  MEM <unsigned int> [(char * {ref-all})_32] = 255;
  MEM <unsigned short> [(char * {ref-all})_32 + 4B] = 0;
  operator delete (_32, 6);
  return 56;

and in GCC 12 we now generate

  <bb 2> [local count: 536870913]:
  MEM <vector(4) unsigned char> [(unsigned char *)&D.24688] = { 255, 0, 0, 0 };
  MEM <vector(2) unsigned char> [(unsigned char *)&D.24688 + 4B] = { 0, 0 };
  _34 = operator new (6);
  MEM <unsigned char[6]> [(char * {ref-all})_34] = MEM <unsigned char[6]>
[(char * {ref-all})&D.24688];
  D.24688 ={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.

  parent reply	other threads:[~2022-02-14 19:07 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-14 15:51 [Bug target/104529] New: [missed optimization] " tnfchris at gcc dot gnu.org
2022-02-14 18:08 ` [Bug target/104529] " pinskia at gcc dot gnu.org
2022-02-14 18:25 ` tnfchris at gcc dot gnu.org
2022-02-14 19:07 ` tnfchris at gcc dot gnu.org [this message]
2022-02-14 19:51 ` [Bug target/104529] [12 Regression] " pinskia at gcc dot gnu.org
2022-02-15  8:02 ` rguenth at gcc dot gnu.org
2022-03-03 12:50 ` jakub at gcc dot gnu.org
2022-03-03 12:53 ` tnfchris at gcc dot gnu.org
2022-03-03 13:18 ` jakub at gcc dot gnu.org
2022-03-03 13:49 ` jakub at gcc dot gnu.org
2022-03-03 14:25 ` [Bug middle-end/104529] " jakub at gcc dot gnu.org
2022-03-04 14:15 ` cvs-commit at gcc dot gnu.org
2022-03-04 14:35 ` jakub at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-104529-4-H9pV0cf1Zv@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).