+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
|| 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;
}