Commit 4a8b97cb by Jakub Jelinek Committed by Jakub Jelinek

re PR tree-optimization/77929 (ICE: verify_gimple failed (error: non-trivial…

re PR tree-optimization/77929 (ICE: verify_gimple failed (error: non-trivial conversion at assignment))

	PR tree-optimization/77929
	* tree-ssa-reassoc.c (optimize_range_tests_var_bound): Handle
	(*ops)[ranges[i].idx]->op != ranges[i].exp case.

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

From-SVN: r241019
parent 83d3ca28
2016-10-12 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/77929
* tree-ssa-reassoc.c (optimize_range_tests_var_bound): Handle
(*ops)[ranges[i].idx]->op != ranges[i].exp case.
2016-10-12 Aaron Sawdey <acsawdey@linux.vnet.ibm.com> 2016-10-12 Aaron Sawdey <acsawdey@linux.vnet.ibm.com>
PR target/77934 PR target/77934
......
2016-10-12 Jakub Jelinek <jakub@redhat.com> 2016-10-12 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/77929
* gcc.c-torture/compile/pr77929.c: New test.
* c-c++-common/Wimplicit-fallthrough-25.c: New test. * c-c++-common/Wimplicit-fallthrough-25.c: New test.
* c-c++-common/Wimplicit-fallthrough-26.c: New test. * c-c++-common/Wimplicit-fallthrough-26.c: New test.
* c-c++-common/Wimplicit-fallthrough-27.c: New test. * c-c++-common/Wimplicit-fallthrough-27.c: New test.
......
/* PR tree-optimization/77929 */
void bar (void);
void
foo (int x, unsigned short int y)
{
int a = 0;
int b = (y != 0) ? (x < y) : (a < 0);
if (x >= 0 & b)
bar ();
}
...@@ -2994,12 +2994,26 @@ optimize_range_tests_var_bound (enum tree_code opcode, int first, int length, ...@@ -2994,12 +2994,26 @@ optimize_range_tests_var_bound (enum tree_code opcode, int first, int length,
} }
else else
{ {
g = gimple_build_assign (make_ssa_name (TREE_TYPE (ranges[i].exp)), operand_entry *oe = (*ops)[ranges[i].idx];
ccode, rhs1, rhs2); tree ctype = oe->op ? TREE_TYPE (oe->op) : boolean_type_node;
if (!INTEGRAL_TYPE_P (ctype)
|| (TREE_CODE (ctype) != BOOLEAN_TYPE
&& TYPE_PRECISION (ctype) != 1))
ctype = boolean_type_node;
g = gimple_build_assign (make_ssa_name (ctype), ccode, rhs1, rhs2);
gimple_set_uid (g, uid); gimple_set_uid (g, uid);
gsi_insert_before (&gsi, g, GSI_SAME_STMT); gsi_insert_before (&gsi, g, GSI_SAME_STMT);
if (oe->op && ctype != TREE_TYPE (oe->op))
{
g = gimple_build_assign (make_ssa_name (TREE_TYPE (oe->op)),
NOP_EXPR, gimple_assign_lhs (g));
gimple_set_uid (g, uid);
gsi_insert_before (&gsi, g, GSI_SAME_STMT);
}
ranges[i].exp = gimple_assign_lhs (g); ranges[i].exp = gimple_assign_lhs (g);
(*ops)[ranges[i].idx]->op = ranges[i].exp; oe->op = ranges[i].exp;
ranges[i].low = build_zero_cst (TREE_TYPE (ranges[i].exp));
ranges[i].high = ranges[i].low;
} }
ranges[i].strict_overflow_p = false; ranges[i].strict_overflow_p = false;
operand_entry *oe = (*ops)[ranges[*idx].idx]; operand_entry *oe = (*ops)[ranges[*idx].idx];
......
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