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/91470] [10/11 Regression] bogus uninitialized warning in trans-intrinsic.c
Date: Fri, 16 Apr 2021 00:06:20 +0000	[thread overview]
Message-ID: <bug-91470-4-3s5NJL5sFn@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-91470-4@http.gcc.gnu.org/bugzilla/>

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |10.2.0, 11.0
   Last reconfirmed|2019-08-27 00:00:00         |2021-4-15
                 CC|                            |msebor at gcc dot gnu.org

--- Comment #5 from Martin Sebor <msebor at gcc dot gnu.org> ---
Reconfirmed with GCC 11 and a reduced/corrected test case and slightly enhanced
output:

$ cat pr91470.c && gcc -O2 -S -Wall pr91470.c
int i1;

int* f1 (int);
void f2 (int, int);
void g2 (int, void *);

void f0 (void)
{
  int *p;

  for (int i = 0; i < 2; i++)
    {
      f2 (0, 0);
      f2 (0, 0);
      f2 (0, 0);
      f2 (0, 0);
      g2 (i1, 0);

      if (i == 0)
        p = f1 (0);
    }

  g2 (i1, p);
}
void f0 ()
{
  int i;
  int * p;
  int i1.0_1;
  int i1.1_2;
  int _6;

  <bb 2> [local count: 357878152]:

  <bb 3> [local count: 715863673]:
  # p_26 = PHI <p_4(6), p_9(D)(2)>
  # i_27 = PHI <_6(6), 0(2)>
  # .MEM_28 = PHI <.MEM_25(6), .MEM_10(D)(2)>
  # .MEM_12 = VDEF <.MEM_28>
  f2 (0, 0);
  # .MEM_13 = VDEF <.MEM_12>
  f2 (0, 0);
  # .MEM_14 = VDEF <.MEM_13>
  f2 (0, 0);
  # .MEM_15 = VDEF <.MEM_14>
  f2 (0, 0);
  # VUSE <.MEM_15>
  i1.0_1 = i1;
  # .MEM_16 = VDEF <.MEM_15>
  g2 (i1.0_1, 0B);
  _6 = i_27 + 1;
  if (_6 == 1)
    goto <bb 4>; [21.69%]
  else
    goto <bb 5>; [78.31%]

  <bb 4> [local count: 155270830]:
  # .MEM_17 = VDEF <.MEM_16>
  p_18 = f1 (0);
  goto <bb 6>; [100.00%]

  <bb 5> [local count: 560592843]:
  if (_6 != 2)
    goto <bb 8>; [36.16%]
  else
    goto <bb 7>; [63.84%]

  <bb 8> [local count: 202714689]:

  <bb 6> [local count: 357985519]:
  # p_4 = PHI <p_26(8), p_18(4)>
  # .MEM_25 = PHI <.MEM_16(8), .MEM_17(4)>
  goto <bb 3>; [100.00%]

  <bb 7> [local count: 357878152]:
  # VUSE <.MEM_16>
  i1.1_2 = i1;
  # .MEM_11 = VDEF <.MEM_16>
  g2 (i1.1_2, p_26); [tail call]
  # VUSE <.MEM_11>
  return;

}

pr91470.c: In function ‘f0’:
pr91470.c:23:3: warning: ‘p’ may be used uninitialized in this function
[-Wmaybe-uninitialized]
   23 |   g2 (i1, p);
      |   ^~~~~~~~~~
pr91470.c:9:8: note: used when ‘i + 1 != 1 && i + 1 != 2 || i + 1 != 1 && i + 1
== 2’
    9 |   int *p;
      |        ^
pr91470.c:9:8: note: ‘p’ was declared here

  parent reply	other threads:[~2021-04-16  0:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-91470-4@http.gcc.gnu.org/bugzilla/>
2021-01-14  8:18 ` rguenth at gcc dot gnu.org
2021-04-16  0:06 ` msebor at gcc dot gnu.org [this message]
2021-04-27 11:38 ` [Bug tree-optimization/91470] [10/11/12 " jakub at gcc dot gnu.org
2021-05-04 12:31 ` rguenth at gcc dot gnu.org
2021-07-28  7:04 ` rguenth at gcc dot gnu.org
2022-04-21  7:47 ` rguenth at gcc dot gnu.org
2022-11-20  4:35 ` law at gcc dot gnu.org
2022-11-21  6:48 ` rguenth at gcc dot gnu.org
2022-12-27 14:48 ` marxin at gcc dot gnu.org
2023-01-09 10:04 ` rguenth at gcc dot gnu.org
2023-05-29 10:02 ` 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-91470-4-3s5NJL5sFn@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).