public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "msebor at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/100370] [11/12 Regression] Incorrect warning for placement new
Date: Mon, 03 May 2021 16:48:57 +0000	[thread overview]
Message-ID: <bug-100370-4-0LpdmDhjJ6@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-100370-4@http.gcc.gnu.org/bugzilla/>

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

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|                            |100399
   Last reconfirmed|                            |2021-05-03
      Known to fail|                            |11.1.0
             Status|UNCONFIRMED                 |NEW
                 CC|                            |msebor at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> ---
Confirmed.  The false positive here is the result of trying to avoid other
false positives for unions and not considering that the pointer might point to
space that's larger than that.  Like the false negative in pr100307 comment 2
(AKA pr100325), this would also be prevented by running -Wplacement-new later,
when the program is in SSA form, rather than from the front end.

  if (code == COMPONENT_REF)
    {
      tree ref = TREE_OPERAND (ptr, 0);
      if (TREE_CODE (TREE_TYPE (ref)) == UNION_TYPE)
        /* In accesses through union types consider the entire unions
           rather than just their members.  */
        ostype = 0;


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100399
[Bug 100399] bogus/missing -Wplacement-new

  parent reply	other threads:[~2021-05-03 16:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-01 11:54 [Bug c++/100370] New: [11.1.0 regression] " foldy at rmki dot kfki.hu
2021-05-03  7:57 ` [Bug c++/100370] [11/12 Regression] " rguenth at gcc dot gnu.org
2021-05-03 16:48 ` msebor at gcc dot gnu.org [this message]
2021-07-28  7:06 ` [Bug c++/100370] [11/12 Regression] Incorrect -Wplacement-new with union rguenth at gcc dot gnu.org
2022-01-20 13:57 ` rguenth at gcc dot gnu.org
2022-04-06 12:14 ` jason at gcc dot gnu.org
2022-04-07  1:29 ` jason at gcc dot gnu.org
2022-04-11 12:38 ` cvs-commit at gcc dot gnu.org
2022-04-21  7:49 ` [Bug c++/100370] [11 " rguenth at gcc dot gnu.org
2023-05-29 10:04 ` 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-100370-4-0LpdmDhjJ6@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).