2007-10-28 Richard Guenther <rguenther@suse.de>
+ * tree-ssa-operands.c (add_vars_for_offset): Add parameter
+ telling if the var is to be treated as points-to location.
+ (add_vars_for_bitmap): Pass true to add_vars_for_offset.
+ (add_virtual_operand): Only recurse into MPTs if aliases
+ is from a NMT.
+
+2007-10-28 Richard Guenther <rguenther@suse.de>
+
* tree-ssa-operands.c (add_vars_for_offset): Clean and speed up.
(add_vars_for_bitmap): Do not recurse further. Only add vars
for pointed-to SFTs.
This is necessary because foop only actually points to foo's first
member, so that is all the points-to set contains. However, an access
to foop->a may be touching some single SFT if we have created some
- SFT's for a structure. */
+ SFT's for a structure. If AS_PTO is false, just add VAR to the vops. */
static bool
add_vars_for_offset (tree full_ref, tree var, HOST_WIDE_INT offset,
- HOST_WIDE_INT size, bool is_call_site, bool is_def)
+ HOST_WIDE_INT size, bool is_call_site, bool is_def,
+ bool as_pto)
{
bool added = false;
subvar_t sv;
return false;
/* For SFTs we have to consider all subvariables of the parent var. */
- if (TREE_CODE (var) != STRUCT_FIELD_TAG)
+ if (TREE_CODE (var) != STRUCT_FIELD_TAG
+ || !as_pto)
{
/* If we do not know the full reference tree or if the access is
unspecified [0, -1], we cannot prune it. Otherwise try doing
if (TREE_CODE (al) == STRUCT_FIELD_TAG)
*none_added &= !add_vars_for_offset (full_ref, al, offset, size,
- is_call_site, is_def);
+ is_call_site, is_def, true);
}
}
/* We have to consider SFTs inside MPTs as possible pointed-to
location as well because even if aliases does not contain
a single SFT, the SFTs inside the MPT may be incomplete in
- that not all aliased subvars have to be in this MPT, too. */
- if (TREE_CODE (al) == MEMORY_PARTITION_TAG)
+ that not all aliased subvars have to be in this MPT, too.
+ But only if we start with NMT aliases. */
+ if (TREE_CODE (al) == MEMORY_PARTITION_TAG
+ && TREE_CODE (var) == NAME_MEMORY_TAG)
add_vars_for_bitmap (MPT_SYMBOLS (al), full_ref, offset, size,
is_call_site, flags & opf_def, &none_added);
none_added &= !add_vars_for_offset (full_ref, al, offset, size,
- is_call_site, flags & opf_def);
+ is_call_site, flags & opf_def,
+ TREE_CODE (var) == NAME_MEMORY_TAG);
}
if (flags & opf_def)