This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/53922] VRP: semantic conflict between range_includes_zero_p and value_inside_range
- From: "amker.cheng at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 11 Jul 2012 08:03:11 +0000
- Subject: [Bug middle-end/53922] VRP: semantic conflict between range_includes_zero_p and value_inside_range
- Auto-submitted: auto-generated
- References: <bug-53922-4@http.gcc.gnu.org/bugzilla/>
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.