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

--- Comment #2 from amker.cheng <amker.cheng at gmail dot com> 2012-07-11 
08:03:11 UTC ---
Yes, the dump before pass vrp2 is like:
main ()
{
  int (*<Tcc0>) (int) cstore.6;
  int g.2;
  int g.0;

<bb 2>:
  g.0_1 = g;
  if (g.0_1 != 0)
    goto <bb 3>;
  else
    goto <bb 4>;

<bb 3>:

<bb 4>:
  # cstore.6_9 = PHI <x(3), y(2)>
  scan_func = cstore.6_9;
  if (cstore.6_9 != 0B)
    goto <bb 5>;
  else
    goto <bb 6>;

<bb 5>:
  g.2_4 = cstore.6_9 (10);
  g = g.2_4;

<bb 6>:
  return 0;

}

gcc parses "# cstore.6_9 = PHI <x(3), y(2)>" and asserts that cstore.6_9
non-zero, then folds predicate cstore.6_9 != 0B to 1, which is wrong, because
weak symbol y could be zero.

Reply via email to