return SSA_NAME_VAR (op);
}
/* Non-SSA parm reference? */
- if (TREE_CODE (op) == PARM_DECL)
+ if (TREE_CODE (op) == PARM_DECL
+ && fbi->aa_walk_budget > 0)
{
bool modified = false;
ao_ref_init (&refd, op);
int walked = walk_aliased_vdefs (&refd, gimple_vuse (stmt),
mark_modified, &modified, NULL, NULL,
- fbi->aa_walk_budget + 1);
+ fbi->aa_walk_budget);
if (walked < 0)
{
fbi->aa_walk_budget = 0;
return NULL_TREE;
}
+ fbi->aa_walk_budget -= walked;
if (!modified)
{
if (size_p)
if (init != error_mark_node)
return 0;
- if (!bb->count.nonzero_p ())
+ if (!bb->count.nonzero_p () || fbi->aa_walk_budget == 0)
return REG_BR_PROB_BASE;
if (dump_file)
{
int walked
= walk_aliased_vdefs (&refd, gimple_vuse (stmt), record_modified, &info,
NULL, NULL, fbi->aa_walk_budget);
+ if (walked > 0)
+ fbi->aa_walk_budget -= walked;
if (walked < 0 || bitmap_bit_p (info.bb_set, bb->index))
{
+ if (walked < 0)
+ fbi->aa_walk_budget = 0;
if (dump_file)
{
if (walked < 0)
|| !BINFO_VTABLE (TYPE_BINFO (TYPE_MAIN_VARIANT (comp_type))))
return true;
+ if (fbi->aa_walk_budget == 0)
+ return false;
+
ao_ref_init (&ao, arg);
ao.base = base;
ao.offset = offset;
int walked
= walk_aliased_vdefs (&ao, gimple_vuse (call), check_stmt_for_type_change,
- &tci, NULL, NULL, fbi->aa_walk_budget + 1);
+ &tci, NULL, NULL, fbi->aa_walk_budget);
+ if (walked >= 0)
+ fbi->aa_walk_budget -= walked;
+ else
+ fbi->aa_walk_budget = 0;
if (walked >= 0 && !tci.type_maybe_changed)
return false;
gcc_checking_assert (fbi);
paa = parm_bb_aa_status_for_bb (fbi, gimple_bb (stmt), index);
- if (paa->parm_modified)
+ if (paa->parm_modified || fbi->aa_walk_budget == 0)
return false;
gcc_checking_assert (gimple_vuse (stmt) != NULL_TREE);
ao_ref_init (&refd, parm_load);
int walked = walk_aliased_vdefs (&refd, gimple_vuse (stmt), mark_modified,
&modified, NULL, NULL,
- fbi->aa_walk_budget + 1);
+ fbi->aa_walk_budget);
if (walked < 0)
{
modified = true;
- if (fbi)
- fbi->aa_walk_budget = 0;
+ fbi->aa_walk_budget = 0;
}
- else if (fbi)
+ else
fbi->aa_walk_budget -= walked;
if (paa && modified)
paa->parm_modified = true;
gcc_checking_assert (fbi);
paa = parm_bb_aa_status_for_bb (fbi, gimple_bb (stmt), index);
- if (paa->ref_modified)
+ if (paa->ref_modified || fbi->aa_walk_budget == 0)
return false;
gcc_checking_assert (gimple_vuse (stmt));
ao_ref_init (&refd, ref);
int walked = walk_aliased_vdefs (&refd, gimple_vuse (stmt), mark_modified,
&modified, NULL, NULL,
- fbi->aa_walk_budget + 1);
+ fbi->aa_walk_budget);
if (walked < 0)
{
modified = true;
struct ipa_param_aa_status *paa = parm_bb_aa_status_for_bb (fbi,
gimple_bb (call),
index);
- if (paa->pt_modified)
+ if (paa->pt_modified || fbi->aa_walk_budget == 0)
return false;
ao_ref_init_from_ptr_and_size (&refd, parm, NULL_TREE);
int walked = walk_aliased_vdefs (&refd, gimple_vuse (call), mark_modified,
&modified, NULL, NULL,
- fbi->aa_walk_budget + 1);
+ fbi->aa_walk_budget);
if (walked < 0)
{
fbi->aa_walk_budget = 0;
of the aggregate is affected by definition of the virtual operand, it
builds a sorted linked list of ipa_agg_jf_list describing that. */
- for (tree dom_vuse = gimple_vuse (call); dom_vuse;)
+ for (tree dom_vuse = gimple_vuse (call);
+ dom_vuse && fbi->aa_walk_budget > 0;)
{
gimple *stmt = SSA_NAME_DEF_STMT (dom_vuse);
continue;
}
+ fbi->aa_walk_budget--;
if (stmt_may_clobber_ref_p_1 (stmt, &r))
{
struct ipa_known_agg_contents_list *content