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 middle-end/88897] [9/10/11 Regression] Bogus maybe-uninitialized warning on class field (missed CSE)
Date: Tue, 06 Apr 2021 20:47:26 +0000	[thread overview]
Message-ID: <bug-88897-4-qswmAMsEsG@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-88897-4@http.gcc.gnu.org/bugzilla/>

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%] 

}

  parent reply	other threads:[~2021-04-06 20:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-88897-4@http.gcc.gnu.org/bugzilla/>
2021-04-06 20:35 ` [Bug middle-end/88897] " msebor at gcc dot gnu.org
2021-04-06 20:47 ` msebor at gcc dot gnu.org [this message]
2021-04-08 14:25 ` [Bug middle-end/88897] [9/10/11 Regression] " 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

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-88897-4-qswmAMsEsG@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).