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 via email to