public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/93181] [9/10/11 Regression] -Wuninitialized fails to warn about uninitialized value
       [not found] <bug-93181-4@http.gcc.gnu.org/bugzilla/>
@ 2021-04-07 20:29 ` msebor at gcc dot gnu.org
  2021-04-08 14:25 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 7+ messages in thread
From: msebor at gcc dot gnu.org @ 2021-04-07 20:29 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|-Wuninitialized fails to    |[9/10/11 Regression]
                   |warn about uninitialized    |-Wuninitialized fails to
                   |value;                      |warn about uninitialized
                   |-Wmaybe-uninitialized       |value
                   |should also warn.           |
                 CC|                            |msebor at gcc dot gnu.org
   Last reconfirmed|2020-01-21 00:00:00         |2021-4-7
      Known to fail|                            |10.2.0, 11.0, 9.2.0

--- Comment #2 from Martin Sebor <msebor at gcc dot gnu.org> ---
Reconfirmed with GCC 11.  The warning ceased to be issued between r120372 and
r120373 so it's technically a regression.

With optimization the warning sees the IL below.  Both arguments of the p_3 PHI
that it considers are valid so it has nothing to complain about.

void ub_express (int x)
{
  struct foo * p;
  int _1;
  int _2;

  <bb 2> [local count: 1073741824]:
  if (x_4(D) == 2)
    goto <bb 5>; [34.00%]
  else
    goto <bb 3>; [66.00%]

  <bb 5> [local count: 365072224]:
  goto <bb 4>; [100.00%]

  <bb 3> [local count: 708669600]:

  <bb 4> [local count: 1073741824]:
  # p_3 = PHI <&a(3), &b(5)>
  # VUSE <.MEM_6(D)>
  _1 = p_3->count;
  _2 = _1 + 1;
  # .MEM_7 = VDEF <.MEM_6(D)>
  p_3->count = _2;
  # VUSE <.MEM_7>
  return;

}

Without optimization the IL (below) does have a PHI with an uninitialized
operand so it could warn then, but it doesn't consider PHI nodes then. 
Considering PHIs in the simplest cases (to avoid false positives) also when
-Wuninitialized runs early, without optimization, would make it possible to
detect this bug.

void ub_express (int x)
{
  struct foo * p;
  int _1;
  int _2;

  <bb 2> :
  if (x_5(D) == 1)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  p_7 = &a;

  <bb 4> :
  # p_3 = PHI <p_6(D)(2), p_7(3)>
  if (x_5(D) == 2)
    goto <bb 5>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 5> :
  p_8 = &b;

  <bb 6> :
  # p_4 = PHI <p_3(4), p_8(5)>
  # VUSE <.MEM_9(D)>
  _1 = p_4->count;
  _2 = _1 + 1;
  # .MEM_10 = VDEF <.MEM_9(D)>
  p_4->count = _2;
  # VUSE <.MEM_10>
  return;

}

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug middle-end/93181] [9/10/11 Regression] -Wuninitialized fails to warn about uninitialized value
       [not found] <bug-93181-4@http.gcc.gnu.org/bugzilla/>
  2021-04-07 20:29 ` [Bug middle-end/93181] [9/10/11 Regression] -Wuninitialized fails to warn about uninitialized value msebor at gcc dot gnu.org
@ 2021-04-08 14:25 ` rguenth at gcc dot gnu.org
  2021-04-30  7:56 ` [Bug middle-end/93181] [9/10/11/12 " rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-04-08 14:25 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |9.4

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug middle-end/93181] [9/10/11/12 Regression] -Wuninitialized fails to warn about uninitialized value
       [not found] <bug-93181-4@http.gcc.gnu.org/bugzilla/>
  2021-04-07 20:29 ` [Bug middle-end/93181] [9/10/11 Regression] -Wuninitialized fails to warn about uninitialized value msebor at gcc dot gnu.org
  2021-04-08 14:25 ` rguenth at gcc dot gnu.org
@ 2021-04-30  7:56 ` rguenth at gcc dot gnu.org
  2021-06-01  8:15 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-04-30  7:56 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug middle-end/93181] [9/10/11/12 Regression] -Wuninitialized fails to warn about uninitialized value
       [not found] <bug-93181-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2021-04-30  7:56 ` [Bug middle-end/93181] [9/10/11/12 " rguenth at gcc dot gnu.org
@ 2021-06-01  8:15 ` rguenth at gcc dot gnu.org
  2022-05-27  9:41 ` [Bug middle-end/93181] [10/11/12/13 " rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-06-01  8:15 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|9.4                         |9.5

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 9.4 is being released, retargeting bugs to GCC 9.5.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug middle-end/93181] [10/11/12/13 Regression] -Wuninitialized fails to warn about uninitialized value
       [not found] <bug-93181-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2021-06-01  8:15 ` rguenth at gcc dot gnu.org
@ 2022-05-27  9:41 ` rguenth at gcc dot gnu.org
  2022-06-28 10:39 ` jakub at gcc dot gnu.org
  2023-07-07 10:36 ` [Bug middle-end/93181] [11/12/13/14 " rguenth at gcc dot gnu.org
  6 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-05-27  9:41 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|9.5                         |10.4

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 9 branch is being closed

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug middle-end/93181] [10/11/12/13 Regression] -Wuninitialized fails to warn about uninitialized value
       [not found] <bug-93181-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2022-05-27  9:41 ` [Bug middle-end/93181] [10/11/12/13 " rguenth at gcc dot gnu.org
@ 2022-06-28 10:39 ` jakub at gcc dot gnu.org
  2023-07-07 10:36 ` [Bug middle-end/93181] [11/12/13/14 " rguenth at gcc dot gnu.org
  6 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-06-28 10:39 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|10.4                        |10.5

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 10.4 is being released, retargeting bugs to GCC 10.5.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug middle-end/93181] [11/12/13/14 Regression] -Wuninitialized fails to warn about uninitialized value
       [not found] <bug-93181-4@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2022-06-28 10:39 ` jakub at gcc dot gnu.org
@ 2023-07-07 10:36 ` rguenth at gcc dot gnu.org
  6 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-07-07 10:36 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|10.5                        |11.5

--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 10 branch is being closed.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-07-07 10:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-93181-4@http.gcc.gnu.org/bugzilla/>
2021-04-07 20:29 ` [Bug middle-end/93181] [9/10/11 Regression] -Wuninitialized fails to warn about uninitialized value msebor at gcc dot gnu.org
2021-04-08 14:25 ` rguenth at gcc dot gnu.org
2021-04-30  7:56 ` [Bug middle-end/93181] [9/10/11/12 " rguenth at gcc dot gnu.org
2021-06-01  8:15 ` rguenth at gcc dot gnu.org
2022-05-27  9:41 ` [Bug middle-end/93181] [10/11/12/13 " rguenth at gcc dot gnu.org
2022-06-28 10:39 ` jakub at gcc dot gnu.org
2023-07-07 10:36 ` [Bug middle-end/93181] [11/12/13/14 " rguenth at gcc dot gnu.org

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).