Commit 7fb66c15 by Marek Polacek Committed by Marek Polacek

re PR tree-optimization/64183 (Complete unroll doesn't happen for a while-loop)

	PR tree-optimization/64183
	* c-gimplify.c (c_gimplify_expr): Don't convert the RHS of a
	shift-expression if it is integer_type_node.  Use types_compatible_p.

	* gcc.dg/tree-ssa/pr64183.c: New test.

From-SVN: r218447
parent c7c81640
2014-12-06 Marek Polacek <polacek@redhat.com>
PR tree-optimization/64183
* c-gimplify.c (c_gimplify_expr): Don't convert the RHS of a
shift-expression if it is integer_type_node. Use types_compatible_p.
2014-11-29 Jakub Jelinek <jakub@redhat.com>
* c-common.c (convert_vector_to_pointer_for_subscript): Remove NULL
......
......@@ -255,7 +255,10 @@ c_gimplify_expr (tree *expr_p, gimple_seq *pre_p ATTRIBUTE_UNUSED,
type demotion/promotion pass. */
tree *op1_p = &TREE_OPERAND (*expr_p, 1);
if (TREE_CODE (TREE_TYPE (*op1_p)) != VECTOR_TYPE
&& TYPE_MAIN_VARIANT (TREE_TYPE (*op1_p)) != unsigned_type_node)
&& !types_compatible_p (TYPE_MAIN_VARIANT (TREE_TYPE (*op1_p)),
unsigned_type_node)
&& !types_compatible_p (TYPE_MAIN_VARIANT (TREE_TYPE (*op1_p)),
integer_type_node))
*op1_p = convert (unsigned_type_node, *op1_p);
break;
}
......
2014-12-06 Marek Polacek <polacek@redhat.com>
PR tree-optimization/64183
* gcc.dg/tree-ssa/pr64183.c: New test.
2014-12-06 H.J. Lu <hongjiu.lu@intel.com>
PR target/64200
......
/* { dg-do compile } */
/* { dg-options "-O3 -fdump-tree-cunroll-details" } */
int bits;
unsigned int size;
int max_code;
void
test ()
{
int code = 0;
while (code < max_code)
code |= ((unsigned int) (size >> (--bits)));
while (bits < (unsigned int)25)
bits += 8;
}
/* { dg-final { scan-tree-dump "Loop 2 iterates at most 4 times" "cunroll"} } */
/* { dg-final { cleanup-tree-dump "cunroll" } } */
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