public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/88518] Function call defeats -Wuninitialized
       [not found] <bug-88518-4@http.gcc.gnu.org/bugzilla/>
@ 2021-04-06 19:59 ` msebor at gcc dot gnu.org
  0 siblings, 0 replies; only message in thread
From: msebor at gcc dot gnu.org @ 2021-04-06 19:59 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
   Last reconfirmed|                            |2021-4-6
         Resolution|---                         |DUPLICATE
                 CC|                            |msebor at gcc dot gnu.org

--- Comment #6 from Martin Sebor <msebor at gcc dot gnu.org> ---
Confirmed as a duplicate of pr60488 (which itself is likely a duplicate of some
older bug).  A variable whose address escapes is not considered by the warning.
 It sees the following IL:

;; Function f (f, funcdef_no=0, decl_uid=1947, cgraph_uid=1, symbol_order=0)

void f ()
{
  long unsigned int i;
  long unsigned int i.0_1;
  long unsigned int _2;

  <bb 2> [local count: 1073741824]:
  # .MEM_4 = VDEF <.MEM_3(D)>
  h ();
  # VUSE <.MEM_4>
  i.0_1 = i;                    <<< i loaded from memory and not considered
  _2 = i.0_1 + 1;               <<< missing -Wuninitialized
  # .MEM_5 = VDEF <.MEM_4>
  i = _2;
  # .MEM_6 = VDEF <.MEM_5>
  g (&i);
  # .MEM_7 = VDEF <.MEM_6>
  i ={v} {CLOBBER};
  # VUSE <.MEM_7>
  return;

}

The pointless load persists until the assembly:

f:
.LFB0:
        .cfi_startproc
        subq    $24, %rsp
        .cfi_def_cfa_offset 32
        call    h
        leaq    8(%rsp), %rdi   <<< i loaded from memory
        addq    $1, 8(%rsp)     <<< i++
        call    g
        addq    $24, %rsp
        .cfi_def_cfa_offset 8
        ret
        .cfi_endproc

*** This bug has been marked as a duplicate of bug 60488 ***

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-04-06 19:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-88518-4@http.gcc.gnu.org/bugzilla/>
2021-04-06 19:59 ` [Bug middle-end/88518] Function call defeats -Wuninitialized msebor 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).