On 11/26/13 13:33, Jakub Jelinek wrote:
Hi!
Given:
_6 = (_Bool) a.1_5;
_7 = _4 | _6;
if (_7 != 0)
goto <bb 5>;
else
goto <bb 6>;
where a.1_5 has int type and _6/_4/_7 are _Bool, register_edge_assert_for_1
happily inserts:
<bb 6>:
a.1_14 = ASSERT_EXPR <a.1_5, a.1_5 == 0>;
assertion, which is wrong, the fact that _6 is known to be 0 doesn't
imply that a.1_5 is zero, as there is a narrowing conversion.
We can only safely look through integer->integer conversions which
are widening or preserve precision.
Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
I'll try to create a testcase for 4.8 branch tomorrow.
2013-11-26 Jakub Jelinek <ja...@redhat.com>
PR tree-optimization/59014
* tree-vrp.c (register_edge_assert_for_1): Don't look
through conversions from non-integral types or through
narrowing conversions.
* gcc.c-torture/execute/pr59014.c: New test.
OK.
jeff