public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/59908] New: Incorrect uninit warning with -fsanitize=address caused by LIM
@ 2014-01-22 17:14 jakub at gcc dot gnu.org
  2014-01-22 17:19 ` [Bug tree-optimization/59908] " mpolacek at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-01-22 17:14 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59908

            Bug ID: 59908
           Summary: Incorrect uninit warning with -fsanitize=address
                    caused by LIM
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jakub at gcc dot gnu.org

struct S
{
  int s;
  struct S *p;
};
extern void bar (void) __attribute__ ((__noreturn__));
extern void baz (struct S **);

void
foo (struct S *x, long c)
{
  int s;
  struct S *y;
  if (c)
    bar ();
lab:
  s = x->s;
  y = x;
  switch (s)
    {
    case 0:
      x = x->p;
      goto lab;
    case 1:
      baz (&y);
    }
}

when compiled with -O2 -Wall -fsanitize=address incorrectly warns about maybe
uninitialized y, with just -O2 -Wall it doesn't (both 4.8 and trunk).

I couldn't find anything wrong in the -fdump-tree-asan1-all dump though, seems
like the problematic uninitialized load is inserted by lim pass, a single store
into y in the loop is replaced by load from uninitialized var before the loop
and 4 different stores after the loop (2 before the __asan_report* noreturn
calls, one before call to baz and one before exit.


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

end of thread, other threads:[~2021-08-08  4:45 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-22 17:14 [Bug tree-optimization/59908] New: Incorrect uninit warning with -fsanitize=address caused by LIM jakub at gcc dot gnu.org
2014-01-22 17:19 ` [Bug tree-optimization/59908] " mpolacek at gcc dot gnu.org
2014-01-29 13:37 ` rguenth at gcc dot gnu.org
2014-03-26 10:09 ` jakub at gcc dot gnu.org
2014-03-26 13:17 ` rguenth at gcc dot gnu.org
2014-04-22 11:37 ` jakub at gcc dot gnu.org
2014-07-16 13:30 ` jakub at gcc dot gnu.org
2014-10-30 10:41 ` jakub at gcc dot gnu.org
2015-06-26 19:57 ` jakub at gcc dot gnu.org
2015-06-26 20:35 ` jakub at gcc dot gnu.org
2021-08-08  4:45 ` pinskia 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).