re PR tree-optimization/64494 (ICE at -Os and above on x86_64-linux-gnu in duplicate_ssa_name_range_info, at tree-ssanames.c:499)

PR tree-optimization/64494
	* tree-ssa-loop-im.c (move_computations_dom_walker::before_dom): Also
	clear SSA_NAME_ANTI_RANGE_P flag.

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

From-SVN: r219194
This commit is contained in:
Jakub Jelinek 2015-01-05 19:53:44 +01:00 committed by Jakub Jelinek
parent 8b7cec587a
commit a6377d52d7
4 changed files with 39 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2015-01-05 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/64494
* tree-ssa-loop-im.c (move_computations_dom_walker::before_dom): Also
clear SSA_NAME_ANTI_RANGE_P flag.
2015-01-05 Marek Polacek <polacek@redhat.com>
* doc/extend.texi (Arrays of Length Zero): Add missing comma.

View File

@ -1,3 +1,8 @@
2015-01-05 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/64494
* gcc.c-torture/compile/pr64494.c: New test.
2015-01-05 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/47674

View File

@ -0,0 +1,18 @@
/* PR tree-optimization/64494 */
int a, b;
unsigned char c;
int
main ()
{
int d;
a = 0;
for (d = 0; d < 2; d++)
{
a &= (b >= 1);
c = (204 > (((unsigned char) ~0) >> a)) ? 0 : 204 << a;
b = 0;
}
return 0;
}

View File

@ -1236,7 +1236,11 @@ move_computations_dom_walker::before_dom_children (basic_block bb)
&& (!ALWAYS_EXECUTED_IN (bb)
|| (ALWAYS_EXECUTED_IN (bb) != level
&& !flow_loop_nested_p (ALWAYS_EXECUTED_IN (bb), level))))
SSA_NAME_RANGE_INFO (gimple_assign_lhs (new_stmt)) = NULL;
{
tree lhs = gimple_assign_lhs (new_stmt);
SSA_NAME_RANGE_INFO (lhs) = NULL;
SSA_NAME_ANTI_RANGE_P (lhs) = 0;
}
gsi_insert_on_edge (loop_preheader_edge (level), new_stmt);
remove_phi_node (&bsi, false);
}
@ -1302,7 +1306,11 @@ move_computations_dom_walker::before_dom_children (basic_block bb)
&& (!ALWAYS_EXECUTED_IN (bb)
|| !(ALWAYS_EXECUTED_IN (bb) == level
|| flow_loop_nested_p (ALWAYS_EXECUTED_IN (bb), level))))
SSA_NAME_RANGE_INFO (gimple_get_lhs (stmt)) = NULL;
{
tree lhs = gimple_get_lhs (stmt);
SSA_NAME_RANGE_INFO (lhs) = NULL;
SSA_NAME_ANTI_RANGE_P (lhs) = 0;
}
/* In case this is a stmt that is not unconditionally executed
when the target loop header is executed and the stmt may
invoke undefined integer or pointer overflow rewrite it to