mirror of git://gcc.gnu.org/git/gcc.git
re PR tree-optimization/59014 (wrong code at -Os and above on x86_64-linux-gnu)
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. From-SVN: r205417
This commit is contained in:
parent
70ec86ee18
commit
b168a8dfcc
|
|
@ -1,5 +1,10 @@
|
||||||
2013-11-26 Jakub Jelinek <jakub@redhat.com>
|
2013-11-26 Jakub Jelinek <jakub@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.
|
||||||
|
|
||||||
PR target/59229
|
PR target/59229
|
||||||
* config/i386/i386.c (device_alg): Fix up formatting.
|
* config/i386/i386.c (device_alg): Fix up formatting.
|
||||||
(ix86_expand_set_or_movmem): Handle max_size < epilogue_size_needed
|
(ix86_expand_set_or_movmem): Handle max_size < epilogue_size_needed
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,8 @@
|
||||||
2013-11-26 Jakub Jelinek <jakub@redhat.com>
|
2013-11-26 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
|
PR tree-optimization/59014
|
||||||
|
* gcc.c-torture/execute/pr59014.c: New test.
|
||||||
|
|
||||||
PR target/59229
|
PR target/59229
|
||||||
* gcc.c-torture/execute/pr59229.c: New test.
|
* gcc.c-torture/execute/pr59229.c: New test.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
/* PR tree-optimization/59014 */
|
||||||
|
|
||||||
|
int a = 2, b, c, d;
|
||||||
|
|
||||||
|
int
|
||||||
|
foo ()
|
||||||
|
{
|
||||||
|
for (;; c++)
|
||||||
|
if ((b > 0) | (a & 1))
|
||||||
|
;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
d = a;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
foo ();
|
||||||
|
if (d != 2)
|
||||||
|
__builtin_abort ();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
@ -5438,9 +5438,13 @@ register_edge_assert_for_1 (tree op, enum tree_code code,
|
||||||
}
|
}
|
||||||
else if (CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (op_def)))
|
else if (CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (op_def)))
|
||||||
{
|
{
|
||||||
/* Recurse through the type conversion. */
|
/* Recurse through the type conversion, unless it is a narrowing
|
||||||
retval |= register_edge_assert_for_1 (gimple_assign_rhs1 (op_def),
|
conversion or conversion from non-integral type. */
|
||||||
code, e, bsi);
|
tree rhs = gimple_assign_rhs1 (op_def);
|
||||||
|
if (INTEGRAL_TYPE_P (TREE_TYPE (rhs))
|
||||||
|
&& (TYPE_PRECISION (TREE_TYPE (rhs))
|
||||||
|
<= TYPE_PRECISION (TREE_TYPE (op))))
|
||||||
|
retval |= register_edge_assert_for_1 (rhs, code, e, bsi);
|
||||||
}
|
}
|
||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue