[Bug regression/49498] [4.7 Regression]: gcc.dg/uninit-pred-8_b.c bogus warning line 20

law at redhat dot com gcc-bugzilla@gcc.gnu.org
Thu Jun 30 19:43:00 GMT 2011


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

Jeffrey A. Law <law at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |xinliangli at gmail dot com

--- Comment #3 from Jeffrey A. Law <law at redhat dot com> 2011-06-30 19:42:47 UTC ---
Frankly, I'm just not able to wrap my head around the tree-ssa-uninit
implementation.  I understand the general concepts, but just can't seem to find
where in that code we handle certain things.  Perhaps it simply doesn't handle
them.

In this simpler sample code we have:

/* { dg-do compile } */
/* { dg-options "-Wuninitialized -O2" } */

int g;
void bar();
void blah(int);

int foo (int n, int l, int m, int r)
{
  int v;

  if (n < 10 || m > 100)
    v = r;

  if (m) g++;

  if ( n < 10 ||  m > 100)
      blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */

  return 0;
}

Compiling with -O2 -Wuninitialized on cris-elf.

Someone who knows the code in tree-ssa-uninit.c really needs to chime in...
Reading that code just makes my head hurt.

>From the standpoint of the resulting CFG, the path 2->8->4->5->6 can never be
traversed, nor can 2->3->9->4->6.  2->3->9->4->5 is properly guarded as far as
I can tell, though I'm not convinced tree-ssa-uninit.c is computing the guards
correctly.



More information about the Gcc-bugs mailing list