public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/88897] Bogus maybe-uninitialized warning on class field (missed CSE)
       [not found] <bug-88897-4@http.gcc.gnu.org/bugzilla/>
@ 2021-04-06 20:35 ` msebor at gcc dot gnu.org
  2021-04-06 20:47 ` [Bug middle-end/88897] [9/10/11 Regression] " msebor at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 9+ messages in thread
From: msebor at gcc dot gnu.org @ 2021-04-06 20:35 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |msebor at gcc dot gnu.org
      Known to fail|                            |10.2.0, 11.0, 8.3.0, 9.3.0
   Last reconfirmed|2019-01-22 00:00:00         |2021-4-6

--- Comment #7 from Martin Sebor <msebor at gcc dot gnu.org> ---
The IL hasn't appreciably changed in GCC 11 so it still issues the warning,
albeit with more detail.

$ gcc -O2 -S -Wall pr88897.C
In constructor ‘temporary_buffer::temporary_buffer(temporary_buffer&&)’,
    inlined from ‘optional::optional(optional&&)’ at pr88897.C:22:79,
    inlined from ‘void foo()’ at pr88897.C:42:57:
pr88897.C:14:63: warning: ‘*(temporary_buffer*)((char*)&_local_state +
offsetof(future_state,
future_state::value.optional::<unnamed>)).temporary_buffer::_buffer’ may be
used uninitialized [-Wmaybe-uninitialized]
   14 |  temporary_buffer(temporary_buffer &&x) noexcept : _buffer(x._buffer) {
      |                                                            ~~^~~~~~~

pr88897.C: In function ‘void foo()’:
pr88897.C:40:16: note: ‘_local_state’ declared here
   40 |   future_state _local_state;
      |                ^~~~~~~~~~~~

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

* [Bug middle-end/88897] [9/10/11 Regression] Bogus maybe-uninitialized warning on class field (missed CSE)
       [not found] <bug-88897-4@http.gcc.gnu.org/bugzilla/>
  2021-04-06 20:35 ` [Bug middle-end/88897] Bogus maybe-uninitialized warning on class field (missed CSE) msebor at gcc dot gnu.org
@ 2021-04-06 20:47 ` msebor at gcc dot gnu.org
  2021-04-08 14:25 ` rguenth at gcc dot gnu.org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 9+ messages in thread
From: msebor at gcc dot gnu.org @ 2021-04-06 20:47 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Bogus maybe-uninitialized   |[9/10/11 Regression] Bogus
                   |warning on class field      |maybe-uninitialized warning
                   |(missed CSE)                |on class field (missed CSE)

--- Comment #8 from Martin Sebor <msebor at gcc dot gnu.org> ---
The warning first appeared in r245840 (GCC 7.0.1 20170302), ironically
committed to fix PR tree-optimization/79345 (passing yet-uninitialized member
as argument to base class constructor should warn (-Wunitialized)).  The IL
emitted just before that revision doesn't look all that different:

void foo() ()
{
  struct future_stateD.2397 _local_stateD.2411;
  struct future_stateD.2397 * _4;
  charD.10 * _6;
  voidD.45 * _7;
  boolD.2220 _8;

;;   basic block 2, loop depth 0, count 0, freq 10000, maybe hot
;;    prev block 0, next block 7, flags: (NEW, REACHABLE, VISITED)
;;    pred:       ENTRY [100.0%]  (FALLTHRU,EXECUTABLE)
  # .MEM_3 = VDEF <.MEM_2(D)>
  # PT = nonlocal escaped null 
  # USE = nonlocal null { D.2411 } (escaped)
  # CLB = nonlocal null { D.2411 } (escaped)
  _4 = _Z3barvD.2407 ();
  # .MEM_5 = VDEF <.MEM_3>
  # USE = nonlocal null { D.2411 } (escaped)
  # CLB = nonlocal null { D.2411 } (escaped)
  _ZN12future_stateC1EvD.2402 (&_local_stateD.2411);
  # .MEM_10 = VDEF <.MEM_5>
  MEM[(struct  &)&_local_stateD.2411] ={v} {CLOBBER};
  # .MEM_11 = VDEF <.MEM_10>
  MEM[(struct optionalD.2323 *)&_local_stateD.2411]._M_engagedD.2340 = 0;
  # PT = nonlocal escaped null 
  _7 = &_4->valueD.2401;
  if (_7 != 0B)
    goto <bb 4>; [73.26%]
  else
    goto <bb 7>; [26.74%]
;;    succ:       4 [73.3%]  (TRUE_VALUE,EXECUTABLE)
;;                7 [26.7%]  (FALSE_VALUE,EXECUTABLE)

;;   basic block 7, loop depth 0, count 0, freq 2674, maybe hot
;;    prev block 2, next block 3, flags: (NEW)
;;    pred:       2 [26.7%]  (FALSE_VALUE,EXECUTABLE)
;;    succ:       3 [100.0%]  (FALLTHRU)

;;   basic block 3, loop depth 0, count 0, freq 6044, maybe hot
;;    prev block 7, next block 4, flags: (NEW, REACHABLE, VISITED)
;;    pred:       7 [100.0%]  (FALLTHRU)
;;                8 [100.0%]  (FALLTHRU)
  # .MEM_17 = PHI <.MEM_11(7), .MEM_13(8)>
  goto <bb 6>; [100.00%]
;;    succ:       6 [100.0%]  (FALLTHRU,EXECUTABLE)

;;   basic block 4, loop depth 0, count 0, freq 7326, maybe hot
;;    prev block 3, next block 8, flags: (NEW, REACHABLE, VISITED)
;;    pred:       2 [73.3%]  (TRUE_VALUE,EXECUTABLE)
  # .MEM_13 = VDEF <.MEM_11>
  MEM[(struct optionalD.2323 *)_4]._M_engagedD.2340 = 0;
  # VUSE <.MEM_13>
  _8 = MEM[(struct optionalD.2323 &)&_local_stateD.2411]._M_engagedD.2340;
  if (_8 != 0)
    goto <bb 5>; [54.00%]
  else
    goto <bb 8>; [46.00%]
;;    succ:       5 [54.0%]  (TRUE_VALUE,EXECUTABLE)
;;                8 [46.0%]  (FALSE_VALUE,EXECUTABLE)

;;   basic block 8, loop depth 0, count 0, freq 3370, maybe hot
;;    prev block 4, next block 5, flags: (NEW)
;;    pred:       4 [46.0%]  (FALSE_VALUE,EXECUTABLE)
  goto <bb 3>; [100.00%]
;;    succ:       3 [100.0%]  (FALLTHRU)

;;   basic block 5, loop depth 0, count 0, freq 3956, maybe hot
;;    prev block 8, next block 6, flags: (NEW, REACHABLE, VISITED)
;;    pred:       4 [54.0%]  (TRUE_VALUE,EXECUTABLE)
  # VUSE <.MEM_13>
  # PT = nonlocal escaped null 
  _6 = MEM[(struct temporary_bufferD.2301 &)&_local_stateD.2411]._bufferD.2303;
  # .MEM_15 = VDEF <.MEM_13>
  MEM[(struct temporary_bufferD.2301 *)_4]._bufferD.2303 = _6;
  # .MEM_16 = VDEF <.MEM_15>
  MEM[(struct optionalD.2323 *)_4]._M_engagedD.2340 = 1;
;;    succ:       6 [100.0%]  (FALLTHRU,EXECUTABLE)

;;   basic block 6, loop depth 0, count 0, freq 10000, maybe hot
;;    prev block 5, next block 1, flags: (NEW, REACHABLE, VISITED)
;;    pred:       5 [100.0%]  (FALLTHRU,EXECUTABLE)
;;                3 [100.0%]  (FALLTHRU,EXECUTABLE)
  # .MEM_1 = PHI <.MEM_16(5), .MEM_17(3)>
  # .MEM_9 = VDEF <.MEM_1>
  _local_stateD.2411 ={v} {CLOBBER};
  # VUSE <.MEM_9>
  return;
;;    succ:       EXIT [100.0%] 

}

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

* [Bug middle-end/88897] [9/10/11 Regression] Bogus maybe-uninitialized warning on class field (missed CSE)
       [not found] <bug-88897-4@http.gcc.gnu.org/bugzilla/>
  2021-04-06 20:35 ` [Bug middle-end/88897] Bogus maybe-uninitialized warning on class field (missed CSE) msebor at gcc dot gnu.org
  2021-04-06 20:47 ` [Bug middle-end/88897] [9/10/11 Regression] " msebor at gcc dot gnu.org
@ 2021-04-08 14:25 ` rguenth at gcc dot gnu.org
  2021-04-30  7:48 ` [Bug middle-end/88897] [9/10/11/12 " rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 9+ 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=88897

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

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

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

* [Bug middle-end/88897] [9/10/11/12 Regression] Bogus maybe-uninitialized warning on class field (missed CSE)
       [not found] <bug-88897-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2021-04-08 14:25 ` rguenth at gcc dot gnu.org
@ 2021-04-30  7:48 ` rguenth at gcc dot gnu.org
  2021-06-01  8:12 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-04-30  7:48 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

* [Bug middle-end/88897] [9/10/11/12 Regression] Bogus maybe-uninitialized warning on class field (missed CSE)
       [not found] <bug-88897-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2021-04-30  7:48 ` [Bug middle-end/88897] [9/10/11/12 " rguenth at gcc dot gnu.org
@ 2021-06-01  8:12 ` rguenth at gcc dot gnu.org
  2022-05-27  9:40 ` [Bug tree-optimization/88897] [10/11/12/13 " rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-06-01  8:12 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #9 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] 9+ messages in thread

* [Bug tree-optimization/88897] [10/11/12/13 Regression] Bogus maybe-uninitialized warning on class field (missed CSE)
       [not found] <bug-88897-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2021-06-01  8:12 ` rguenth at gcc dot gnu.org
@ 2022-05-27  9:40 ` rguenth at gcc dot gnu.org
  2022-06-28 10:36 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-05-27  9:40 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

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

* [Bug tree-optimization/88897] [10/11/12/13 Regression] Bogus maybe-uninitialized warning on class field (missed CSE)
       [not found] <bug-88897-4@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2022-05-27  9:40 ` [Bug tree-optimization/88897] [10/11/12/13 " rguenth at gcc dot gnu.org
@ 2022-06-28 10:36 ` jakub at gcc dot gnu.org
  2022-11-20  4:29 ` [Bug tree-optimization/88897] [10/11/12 " law at gcc dot gnu.org
  2023-07-07 10:34 ` [Bug tree-optimization/88897] [11/12 " rguenth at gcc dot gnu.org
  8 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-06-28 10:36 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #11 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] 9+ messages in thread

* [Bug tree-optimization/88897] [10/11/12 Regression] Bogus maybe-uninitialized warning on class field (missed CSE)
       [not found] <bug-88897-4@http.gcc.gnu.org/bugzilla/>
                   ` (6 preceding siblings ...)
  2022-06-28 10:36 ` jakub at gcc dot gnu.org
@ 2022-11-20  4:29 ` law at gcc dot gnu.org
  2023-07-07 10:34 ` [Bug tree-optimization/88897] [11/12 " rguenth at gcc dot gnu.org
  8 siblings, 0 replies; 9+ messages in thread
From: law at gcc dot gnu.org @ 2022-11-20  4:29 UTC (permalink / raw)
  To: gcc-bugs

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

Jeffrey A. Law <law at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |law at gcc dot gnu.org
            Summary|[10/11/12/13 Regression]    |[10/11/12 Regression] Bogus
                   |Bogus maybe-uninitialized   |maybe-uninitialized warning
                   |warning on class field      |on class field (missed CSE)
                   |(missed CSE)                |

--- Comment #12 from Jeffrey A. Law <law at gcc dot gnu.org> ---
We're catching the previously missed CSE opportunity in fre1 now, and (of
course) we no longer get the bogus warning.  Removing the 13 regression marker.
 Finding and backporting the specific change seems like it's not worth it, but
leaving open with the other regression markers for now.

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

* [Bug tree-optimization/88897] [11/12 Regression] Bogus maybe-uninitialized warning on class field (missed CSE)
       [not found] <bug-88897-4@http.gcc.gnu.org/bugzilla/>
                   ` (7 preceding siblings ...)
  2022-11-20  4:29 ` [Bug tree-optimization/88897] [10/11/12 " law at gcc dot gnu.org
@ 2023-07-07 10:34 ` rguenth at gcc dot gnu.org
  8 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-07-07 10:34 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

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

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

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-88897-4@http.gcc.gnu.org/bugzilla/>
2021-04-06 20:35 ` [Bug middle-end/88897] Bogus maybe-uninitialized warning on class field (missed CSE) msebor at gcc dot gnu.org
2021-04-06 20:47 ` [Bug middle-end/88897] [9/10/11 Regression] " msebor at gcc dot gnu.org
2021-04-08 14:25 ` rguenth at gcc dot gnu.org
2021-04-30  7:48 ` [Bug middle-end/88897] [9/10/11/12 " rguenth at gcc dot gnu.org
2021-06-01  8:12 ` rguenth at gcc dot gnu.org
2022-05-27  9:40 ` [Bug tree-optimization/88897] [10/11/12/13 " rguenth at gcc dot gnu.org
2022-06-28 10:36 ` jakub at gcc dot gnu.org
2022-11-20  4:29 ` [Bug tree-optimization/88897] [10/11/12 " law at gcc dot gnu.org
2023-07-07 10:34 ` [Bug tree-optimization/88897] [11/12 " 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).