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

* [Bug tree-optimization/59908] Incorrect uninit warning with -fsanitize=address caused by LIM
  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 ` mpolacek at gcc dot gnu.org
  2014-01-29 13:37 ` rguenth at gcc dot gnu.org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2014-01-22 17:19 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-01-22
                 CC|                            |mpolacek at gcc dot gnu.org
   Target Milestone|---                         |4.9.0
     Ever confirmed|0                           |1

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Confirmed.


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

* [Bug tree-optimization/59908] Incorrect uninit warning with -fsanitize=address caused by LIM
  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
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-01-29 13:37 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
There is a very old duplicate somewhere.  Happens with store-motion for a
simple

void foo (int n)
{
  int x, i;
  for (i = 0; i < n; ++i)
    x = i;
  bar (&x);
}

IIRC.  Of course requires us to re-write x into SSA form later, so some more
"clever" testcase is required.  LIM does:

  <bb 2>:
  if (n_4(D) > 0)
    goto <bb 3>;
  else
    goto <bb 9>;

  <bb 3>:
  x_lsm.3_5 = x;
^^^^
load of uninitialized x


  <bb 4>:
  # i_11 = PHI <i_6(5), 0(3)>
  x_lsm.3_1 = i_11;
  i_6 = i_11 + 1;
  if (n_4(D) > i_6)
    goto <bb 5>;
  else
    goto <bb 10>;

  <bb 10>:
  # x_lsm.3_9 = PHI <x_lsm.3_1(4)>
  x = x_lsm.3_9;
  goto <bb 7>;

now go find the duplicate ;)


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

* [Bug tree-optimization/59908] Incorrect uninit warning with -fsanitize=address caused by LIM
  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
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-03-26 10:09 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |burnus at gcc dot gnu.org

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
*** Bug 60649 has been marked as a duplicate of this bug. ***


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

* [Bug tree-optimization/59908] Incorrect uninit warning with -fsanitize=address caused by LIM
  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
                   ` (2 preceding siblings ...)
  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
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-03-26 13:17 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
PR39612?


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

* [Bug tree-optimization/59908] Incorrect uninit warning with -fsanitize=address caused by LIM
  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
                   ` (3 preceding siblings ...)
  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
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-04-22 11:37 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.9.0                       |4.9.1

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 4.9.0 has been released


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

* [Bug tree-optimization/59908] Incorrect uninit warning with -fsanitize=address caused by LIM
  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
                   ` (4 preceding siblings ...)
  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
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-07-16 13:30 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.9.1                       |4.9.2

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 4.9.1 has been released.


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

* [Bug tree-optimization/59908] Incorrect uninit warning with -fsanitize=address caused by LIM
  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
                   ` (5 preceding siblings ...)
  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
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-10-30 10:41 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.9.2                       |4.9.3

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 4.9.2 has been released.


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

* [Bug tree-optimization/59908] Incorrect uninit warning with -fsanitize=address caused by LIM
  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
                   ` (6 preceding siblings ...)
  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
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-06-26 19:57 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 4.9.3 has been released.


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

* [Bug tree-optimization/59908] Incorrect uninit warning with -fsanitize=address caused by LIM
  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
                   ` (7 preceding siblings ...)
  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
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-06-26 20:35 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.9.3                       |4.9.4


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

* [Bug tree-optimization/59908] Incorrect uninit warning with -fsanitize=address caused by LIM
  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
                   ` (8 preceding siblings ...)
  2015-06-26 20:35 ` jakub at gcc dot gnu.org
@ 2021-08-08  4:45 ` pinskia at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-08  4:45 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
   Target Milestone|---                         |4.9.2
             Status|NEW                         |RESOLVED

--- Comment #9 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Fixed for GCC 5 with r5-2621 and 4.9.2 with g:5456720833910e .

Basically The inlining of the ASAN_CHECK later on fixes the issue.

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