Commit c2152239 by Jakub Jelinek Committed by Jakub Jelinek

re PR tree-optimization/38807 (ice: gimple check: expected…

re PR tree-optimization/38807 (ice: gimple check: expected gimple_assign(error_mark), have gimple_phi())

	PR tree-optimization/38807
	* tree-ssa-reassoc.c (remove_visited_stmt_chain): Don't look at
	gimple_visited_p unless stmt is GIMPLE_ASSIGN.

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

From-SVN: r143289
parent 0e510b3e
2009-01-12 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/38807
* tree-ssa-reassoc.c (remove_visited_stmt_chain): Don't look at
gimple_visited_p unless stmt is GIMPLE_ASSIGN.
2009-01-11 Adam Nemet <anemet@caviumnetworks.com>
* expmed.c (store_bit_field_1): Properly truncate the paradoxical
......
2009-01-12 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/38807
* gcc.c-torture/compile/pr38807.c: New test.
2009-01-11 Adam Nemet <anemet@caviumnetworks.com>
* gcc.target/mips/ins-2.c: New test.
......
/* PR tree-optimization/38807 */
int
baz (short x)
{
return x;
}
int a, b;
int
bar (int x)
{
if (baz (a ^ x ^ a))
return b;
return 0;
}
int
foo (void)
{
return bar (a == 0 || 1 == 1 - a) ? 1 : bar (1 && a);
}
/* Reassociation for trees.
Copyright (C) 2005, 2007, 2008 Free Software Foundation, Inc.
Copyright (C) 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
Contributed by Daniel Berlin <dan@dberlin.org>
This file is part of GCC.
......@@ -1279,7 +1279,8 @@ remove_visited_stmt_chain (tree var)
if (TREE_CODE (var) != SSA_NAME || !has_zero_uses (var))
return;
stmt = SSA_NAME_DEF_STMT (var);
if (!gimple_visited_p (stmt))
if (!is_gimple_assign (stmt)
|| !gimple_visited_p (stmt))
return;
var = gimple_assign_rhs1 (stmt);
gsi = gsi_for_stmt (stmt);
......
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