mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-08 19:20:44 +08:00
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
This commit is contained in:
parent
0fbdb0c088
commit
f39b06395e
@ -1,3 +1,9 @@
|
||||
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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user