Commit 86c8eea6 by Richard Biener Committed by Richard Biener

re PR tree-optimization/86816 (ICE: SIGSEGV in tree-ssa-pre / tail_merge_optimize)

2018-08-02  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/86816
	* tree-ssa-tail-merge.c (tail_merge_valueize): New function
	which checks for value availability before querying it.
	(gvn_uses_equal): Use it.
	(same_succ_hash): Likewise.
	(gimple_equal_p): Likewise.

	* g++.dg/torture/pr86816.C: New testcase.

From-SVN: r263257
parent 593d93cb
2018-08-02 Richard Biener <rguenther@suse.de>
PR tree-optimization/86816
* tree-ssa-tail-merge.c (tail_merge_valueize): New function
which checks for value availability before querying it.
(gvn_uses_equal): Use it.
(same_succ_hash): Likewise.
(gimple_equal_p): Likewise.
2018-08-02 Nick Clifton <nickc@redhat.com>
PR target/86789
......
2018-08-02 Richard Biener <rguenther@suse.de>
PR tree-optimization/86816
* g++.dg/torture/pr86816.C: New testcase.
2018-08-02 Richard Sandiford <richard.sandiford@arm.com>
* gcc.target/aarch64/f16_mov_immediate_1.c: Expect fmov immediate
......
// { dg-do compile }
class Signal
{
public:
int m_Mode;
};
class Ctx
{
public:
bool m_Invert;
void DoSomething();
};
class Test
{
void TestIce( Ctx& ctx, Signal* sig);
};
void Test::TestIce( Ctx& ctx, Signal* sig)
{
int invert = false;
if( ! ctx.m_Invert)
invert = ! invert;
switch( sig->m_Mode)
{
case 1:
invert = ! invert;
break;
case 2:
invert = true;
break;
}
if( invert)
ctx.DoSomething();
}
......@@ -286,6 +286,21 @@ struct aux_bb_info
#define BB_VOP_AT_EXIT(bb) (((struct aux_bb_info *)bb->aux)->vop_at_exit)
#define BB_DEP_BB(bb) (((struct aux_bb_info *)bb->aux)->dep_bb)
/* Valueization helper querying the VN lattice. */
static tree
tail_merge_valueize (tree name)
{
if (TREE_CODE (name) == SSA_NAME
&& has_VN_INFO (name))
{
tree tem = VN_INFO (name)->valnum;
if (tem != VN_TOP)
return tem;
}
return name;
}
/* Returns true if the only effect a statement STMT has, is to define locally
used SSA_NAMEs. */
......@@ -371,7 +386,7 @@ gvn_uses_equal (tree val1, tree val2)
if (val1 == val2)
return true;
if (vn_valueize (val1) != vn_valueize (val2))
if (tail_merge_valueize (val1) != tail_merge_valueize (val2))
return false;
return ((TREE_CODE (val1) == SSA_NAME || CONSTANT_CLASS_P (val1))
......@@ -481,7 +496,7 @@ same_succ_hash (const same_succ *e)
for (i = 0; i < gimple_call_num_args (stmt); i++)
{
arg = gimple_call_arg (stmt, i);
arg = vn_valueize (arg);
arg = tail_merge_valueize (arg);
inchash::add_expr (arg, hstate);
}
}
......@@ -1147,7 +1162,7 @@ gimple_equal_p (same_succ *same_succ, gimple *s1, gimple *s2)
if (lhs1 == NULL_TREE || lhs2 == NULL_TREE)
return false;
if (TREE_CODE (lhs1) == SSA_NAME && TREE_CODE (lhs2) == SSA_NAME)
return vn_valueize (lhs1) == vn_valueize (lhs2);
return tail_merge_valueize (lhs1) == tail_merge_valueize (lhs2);
return operand_equal_p (lhs1, lhs2, 0);
case GIMPLE_ASSIGN:
......
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