gcall *stmt = as_a <gcall *> (gsi_stmt (*gsi));
tree callee;
bool changed = false;
- unsigned i;
-
- /* Fold *& in call arguments. */
- for (i = 0; i < gimple_call_num_args (stmt); ++i)
- if (REFERENCE_CLASS_P (gimple_call_arg (stmt, i)))
- {
- tree tmp = maybe_fold_reference (gimple_call_arg (stmt, i));
- if (tmp)
- {
- gimple_call_set_arg (stmt, i, tmp);
- changed = true;
- }
- }
/* Check for virtual calls that became direct calls. */
callee = gimple_call_fn (stmt);
gimple_call_set_chain (stmt, NULL);
changed = true;
}
- else
- {
- tree tmp = maybe_fold_reference (gimple_call_chain (stmt));
- if (tmp)
- {
- gimple_call_set_chain (stmt, tmp);
- changed = true;
- }
- }
}
if (inplace)
changed |= gimple_fold_call (gsi, inplace);
break;
- case GIMPLE_ASM:
- /* Fold *& in asm operands. */
- {
- gasm *asm_stmt = as_a <gasm *> (stmt);
- size_t noutputs;
- const char **oconstraints;
- const char *constraint;
- bool allows_mem, allows_reg;
-
- noutputs = gimple_asm_noutputs (asm_stmt);
- oconstraints = XALLOCAVEC (const char *, noutputs);
-
- for (i = 0; i < noutputs; ++i)
- {
- tree link = gimple_asm_output_op (asm_stmt, i);
- oconstraints[i]
- = TREE_STRING_POINTER (TREE_VALUE (TREE_PURPOSE (link)));
- }
- for (i = 0; i < gimple_asm_ninputs (asm_stmt); ++i)
- {
- tree link = gimple_asm_input_op (asm_stmt, i);
- tree op = TREE_VALUE (link);
- constraint
- = TREE_STRING_POINTER (TREE_VALUE (TREE_PURPOSE (link)));
- parse_input_constraint (&constraint, 0, 0, noutputs, 0,
- oconstraints, &allows_mem, &allows_reg);
- if (REFERENCE_CLASS_P (op)
- && (allows_reg || !allows_mem)
- && (op = maybe_fold_reference (op)) != NULL_TREE)
- {
- TREE_VALUE (link) = op;
- changed = true;
- }
- }
- }
- break;
-
case GIMPLE_DEBUG:
if (gimple_debug_bind_p (stmt))
{