------- Comment #2 from pinskia at gcc dot gnu dot org  2007-03-12 15:09 -------
I should mention, unless it can produce a constant result.
For an example this function:

void bar (void * a)
{
  struct foo Foo;
  int i;

  for (i=0; i<3; ++i)
    {
      void *p = a;
      int *pi = (int *)p;
      if (pi != 0)
        {
          *pi = 0;
        }
    }
}

Should not be transformed into:

void bar (void * a)
{
  struct foo Foo;
  int i;

  for (i=0; i<3; ++i)
    {
      void *p = a;
      int *pi = (int *)p;
      if (p != 0)
        {
          *pi = 0;
        }
    }
}

As VRP is not as smart as there is no back tracking of ranges.


-- 


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

Reply via email to