@@ -319,6 +319,8 @@ struct check_defs_data
{
/* If we found any may-defs besides must-def clobbers. */
bool found_may_defs;
+ /* If we found a GIMPLE clobber that made the whole ref undefined. */
+ bool found_full_clobber;
};
/* Return true if STMT is a call to built-in function all of whose
@@ -501,7 +503,10 @@ check_defs (ao_ref *ref, tree vdef, void *data_)
if (gimple_clobber_p (def_stmt))
{
if (stmt_kills_ref_p (def_stmt, ref))
- return true;
+ {
+ data->found_full_clobber = true;
+ return true;
+ }
return false;
}
@@ -601,6 +606,7 @@ maybe_warn_operand (ao_ref &ref, gimple *stmt, tree lhs, tree rhs,
check_defs_data data;
bool fentry_reached = false;
data.found_may_defs = false;
+ data.found_full_clobber = false;
tree use = gimple_vuse (stmt);
if (!use)
return NULL_TREE;
@@ -666,7 +672,10 @@ maybe_warn_operand (ao_ref &ref, gimple *stmt, tree lhs, tree rhs,
if (tree ba = get_base_address (base))
base = ba;
}
+ }
+ if (fentry_reached || data.found_full_clobber)
+ {
/* Replace the RHS expression with BASE so that it
refers to it in the diagnostic (instead of to
'<unknown>'). */