Commit 28fd0ba2 by Jakub Jelinek Committed by Jakub Jelinek

re PR tree-optimization/58364 (likely wrong code bug)

	PR tree-optimization/58364
	* tree-ssa-reassoc.c (init_range_entry): For BIT_NOT_EXPR on
	BOOLEAN_TYPE, only invert in_p and continue with arg0 if
	the current range can't be an unconditional true or false.

	* gcc.c-torture/execute/pr58364.c: New test.

From-SVN: r202409
parent 552d99fe
2013-09-09 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/58364
* tree-ssa-reassoc.c (init_range_entry): For BIT_NOT_EXPR on
BOOLEAN_TYPE, only invert in_p and continue with arg0 if
the current range can't be an unconditional true or false.
2013-09-09 James Greenhalgh <james.greenhalgh@arm.com>
* config/aarch64/arm_neon.h (vrsqrte_f64): Fix parameter type.
......
2013-09-09 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/58364
* gcc.c-torture/execute/pr58364.c: New test.
2013-09-09 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/43452
......
/* PR tree-optimization/58364 */
int a = 1, b, c;
int
foo (int x)
{
return x < 0 ? 1 : x;
}
int
main ()
{
if (foo (a > c == (b = 0)))
__builtin_abort ();
return 0;
}
......@@ -1801,7 +1801,14 @@ init_range_entry (struct range_entry *r, tree exp, gimple stmt)
switch (code)
{
case BIT_NOT_EXPR:
if (TREE_CODE (TREE_TYPE (exp)) == BOOLEAN_TYPE)
if (TREE_CODE (TREE_TYPE (exp)) == BOOLEAN_TYPE
/* Ensure the range is either +[-,0], +[0,0],
-[-,0], -[0,0] or +[1,-], +[1,1], -[1,-] or
-[1,1]. If it is e.g. +[-,-] or -[-,-]
or similar expression of unconditional true or
false, it should not be negated. */
&& ((high && integer_zerop (high))
|| (low && integer_onep (low))))
{
in_p = !in_p;
exp = arg0;
......
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