Commit f39b0639 by Martin Liska Committed by Martin Liska

Mark necessary 2nd and later args for delete op.

2019-07-31  Martin Liska  <mliska@suse.cz>

	* tree-ssa-dce.c (propagate_necessity): Delete operator can
	have size and (or) alignment as 2nd and later arguments.
	Mark all of them as necessary.

From-SVN: r273929
parent 0fbdb0c0
2019-07-31 Martin Liska <mliska@suse.cz>
* tree-ssa-dce.c (propagate_necessity): Delete operator can
have size and (or) alignment as 2nd and later arguments.
Mark all of them as necessary.
2019-07-31 Richard Biener <rguenther@suse.de>
PR tree-optimization/91178
......
......@@ -824,13 +824,16 @@ propagate_necessity (bool aggressive)
|| DECL_FUNCTION_CODE (def_callee) == BUILT_IN_CALLOC))
|| DECL_IS_REPLACEABLE_OPERATOR_NEW_P (def_callee)))
{
/* Some delete operators have size as 2nd argument. */
/* Delete operators can have alignment and (or) size as next
arguments. When being a SSA_NAME, they must be marked
as necessary. */
if (is_delete_operator && gimple_call_num_args (stmt) >= 2)
{
tree size_argument = gimple_call_arg (stmt, 1);
if (TREE_CODE (size_argument) == SSA_NAME)
mark_operand_necessary (size_argument);
}
for (unsigned i = 1; i < gimple_call_num_args (stmt); i++)
{
tree arg = gimple_call_arg (stmt, i);
if (TREE_CODE (arg) == SSA_NAME)
mark_operand_necessary (arg);
}
continue;
}
......
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