Commit b8d85005 by Jakub Jelinek Committed by Jakub Jelinek

re PR middle-end/86123 (ICE in prepare_cmp_insn, at optabs.c:3967)

	PR middle-end/86123
	* match.pd ((X / Y) == 0 -> X < Y): Don't transform complex divisions.
	Fix up comment formatting.

	* gcc.c-torture/compile/pr86123.c: New test.

From-SVN: r261647
parent b48f2352
2018-06-15 Jakub Jelinek <jakub@redhat.com>
PR middle-end/86123
* match.pd ((X / Y) == 0 -> X < Y): Don't transform complex divisions.
Fix up comment formatting.
2018-06-15 Bernd Edlinger <bernd.edlinger@hotmail.de> 2018-06-15 Bernd Edlinger <bernd.edlinger@hotmail.de>
* typed-splay-tree.h (typed_splay_tree::remove): New function. * typed-splay-tree.h (typed_splay_tree::remove): New function.
......
...@@ -1462,14 +1462,15 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) ...@@ -1462,14 +1462,15 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
(op @1 { build_zero_cst (TREE_TYPE (@1)); })))) (op @1 { build_zero_cst (TREE_TYPE (@1)); }))))
/* Transform: /* Transform:
* (X / Y) == 0 -> X < Y if X, Y are unsigned. (X / Y) == 0 -> X < Y if X, Y are unsigned.
* (X / Y) != 0 -> X >= Y, if X, Y are unsigned. (X / Y) != 0 -> X >= Y, if X, Y are unsigned. */
*/
(for cmp (eq ne) (for cmp (eq ne)
ocmp (lt ge) ocmp (lt ge)
(simplify (simplify
(cmp (trunc_div @0 @1) integer_zerop) (cmp (trunc_div @0 @1) integer_zerop)
(if (TYPE_UNSIGNED (TREE_TYPE (@0)) (if (TYPE_UNSIGNED (TREE_TYPE (@0))
/* Complex ==/!= is allowed, but not </>=. */
&& TREE_CODE (TREE_TYPE (@0)) != COMPLEX_TYPE
&& (VECTOR_TYPE_P (type) || !VECTOR_TYPE_P (TREE_TYPE (@0)))) && (VECTOR_TYPE_P (type) || !VECTOR_TYPE_P (TREE_TYPE (@0))))
(ocmp @0 @1)))) (ocmp @0 @1))))
......
2018-06-15 Jakub Jelinek <jakub@redhat.com>
PR middle-end/86123
* gcc.c-torture/compile/pr86123.c: New test.
2018-06-15 Tom de Vries <tdevries@suse.de> 2018-06-15 Tom de Vries <tdevries@suse.de>
* gcc.dg-selftests/dg-final.exp: Force sequential execution. * gcc.dg-selftests/dg-final.exp: Force sequential execution.
......
/* PR middle-end/86123 */
int
foo (_Complex unsigned x, _Complex unsigned y)
{
_Complex unsigned t1 = x / y;
int t2 = (t1 != 0);
return t2;
}
int
bar (_Complex unsigned x, _Complex unsigned y)
{
_Complex unsigned t1 = x / y;
int t2 = (t1 == 0);
return t2;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment