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 tree-optimization/100086] [11 Regression] spurious -Wnonnull with __builtin_expect
Date: Wed, 14 Apr 2021 20:32:48 +0000	[thread overview]
Message-ID: <bug-100086-4-VDwYqXEq0J@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-100086-4@http.gcc.gnu.org/bugzilla/>

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2021-04-14
                URL|                            |https://bugzilla.redhat.com
                   |                            |/show_bug.cgi?id=1948775
             Blocks|                            |95507
      Known to fail|                            |11.0
           Keywords|                            |diagnostic
             Status|UNCONFIRMED                 |NEW
            Summary|spurious -Wnonnull with     |[11 Regression] spurious
                   |__builtin_expect            |-Wnonnull with
                   |                            |__builtin_expect
     Ever confirmed|0                           |1

--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> ---
According to my bisection the warning first appeared in GCC 11, with
g:fcae5121154d1c3382b056bcc2c563cedac28e74.  Before then the post_ipa_warn dump
looked like so:

;; Function TestBody (_Z8TestBodyv, funcdef_no=8, decl_uid=2406, cgraph_uid=9,
symbol_order=8)

TestBody ()
{
  struct RefPtr emptyTake;
  struct string D.2453;
  struct AssertHelper D.2481;
  bool _1;
  char * _2;
  char * _14;
  bool _15;
  char * _16;
  bool _17;
  long int _18;
  long int _19;
  long int _20;
  long int _21;
  char * _22;
  bool _23;
  long int _24;
  long int _25;

  <bb 2> [local count: 1073741824]:
  emptyTake = take (); [return slot optimization]
  _14 = emptyTake.p;
  _15 = _14 != 0B;
  _1 = _14 == 0B;
  if (_1 != 0)
    goto <bb 9>; [79.76%]
  else
    goto <bb 3>; [20.24%]

  <bb 3> [local count: 217325344]:
  D.2453 = GetMessage ();

  <bb 4> [local count: 217325344]:
  _2 = D.2453.p;
  AssertHelper::AssertHelper (&D.2481, _2);

  <bb 5> [local count: 217325344]:
  AssertHelper::operator= (&D.2481, 1);

  <bb 6> [local count: 217325344]:
  D.2481 ={v} {CLOBBER};
  _16 = emptyTake.p;
  _17 = _16 != 0B;
  _18 = (long int) _17;
  _19 = _18;
  if (_19 != 0)
    goto <bb 7>; [90.00%]
  else
    goto <bb 8>; [10.00%]

  <bb 7> [local count: 195592809]:
  __builtin_puts (_16);

  <bb 8> [local count: 217325344]:
  emptyTake ={v} {CLOBBER};
  emptyTake ={v} {CLOBBER};
  goto <bb 12>; [100.00%]

  <bb 9> [local count: 856416481]:
  _20 = (long int) _15;
  _21 = _20;
  if (_21 != 0)
    goto <bb 10>; [90.00%]
  else
    goto <bb 11>; [10.00%]

  <bb 10> [local count: 770774832]:
  __builtin_puts (_14);

  <bb 11> [local count: 856416481]:
  emptyTake ={v} {CLOBBER};
  emptyTake ={v} {CLOBBER};

  <bb 12> [local count: 1073741824]:
  return;

  <bb 13> [count: 0]:
<L8>:
  D.2481 ={v} {CLOBBER};
  _22 = emptyTake.p;
  _23 = _22 != 0B;
  _24 = (long int) _23;
  _25 = _24;
  if (_25 != 0)
    goto <bb 14>; [0.00%]
  else
    goto <bb 15>; [0.00%]

  <bb 14> [count: 0]:
  __builtin_puts (_22);

  <bb 15> [count: 0]:
  emptyTake ={v} {CLOBBER};
  resx 2

}


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95507
[Bug 95507] [meta-bug] bogus/missing -Wnonnull

  reply	other threads:[~2021-04-14 20:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-14 20:28 [Bug tree-optimization/100086] New: " msebor at gcc dot gnu.org
2021-04-14 20:32 ` msebor at gcc dot gnu.org [this message]
2021-04-15  7:00 ` [Bug tree-optimization/100086] [11 Regression] " rguenth at gcc dot gnu.org
2021-04-27 11:40 ` [Bug tree-optimization/100086] [11/12 " jakub at gcc dot gnu.org
2021-07-28  7:06 ` rguenth at gcc dot gnu.org
2022-01-21 12:37 ` [Bug tree-optimization/100086] [11 " rguenth at gcc dot gnu.org
2022-01-31 14:52 ` marxin at gcc dot gnu.org
2022-04-21  7:49 ` 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-100086-4-VDwYqXEq0J@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).