Commit 4a648c5d by Richard Guenther Committed by Richard Biener

tree-ssa-alias.c (create_overlap_variables_for): Make sure to only create SFTs…

tree-ssa-alias.c (create_overlap_variables_for): Make sure to only create SFTs if we also create variable infos for PTA.

2007-11-15  Richard Guenther  <rguenther@suse.de>

	* tree-ssa-alias.c (create_overlap_variables_for): Make sure
	to only create SFTs if we also create variable infos for PTA.
	* tree-ssa-structalias.c (set_uids_in_ptset): Add all overlapping
	SFTs.

From-SVN: r130197
parent f83ca251
2007-11-15 Richard Guenther <rguenther@suse.de>
* tree-ssa-alias.c (create_overlap_variables_for): Make sure
to only create SFTs if we also create variable infos for PTA.
* tree-ssa-structalias.c (set_uids_in_ptset): Add all overlapping
SFTs.
2007-11-15 Richard Guenther <rguenther@suse.de>
* tree-ssa-structalias.c (set_uids_in_ptset): Use the pointed-to
type for TBAA pruning.
(find_what_p_points_to): Call set_uids_in_ptset with the original
......@@ -3834,7 +3834,10 @@ create_overlap_variables_for (tree var)
push_fields_onto_fieldstack (TREE_TYPE (var), &fieldstack, 0, NULL,
TREE_TYPE (var), 0);
if (VEC_length (fieldoff_s, fieldstack) != 0)
/* Make sure to not create SFTs for structs we won't generate variable
infos for. See tree-ssa-structalias.c:create_variable_info_for (). */
if (VEC_length (fieldoff_s, fieldstack) != 0
&& VEC_length (fieldoff_s, fieldstack) <= MAX_FIELDS_FOR_FIELD_SENSITIVE)
{
subvar_t *subvars;
fieldoff_s *fo;
......
......@@ -4749,15 +4749,24 @@ set_uids_in_ptset (tree ptr, bitmap into, bitmap from, bool is_derefed,
|| TREE_CODE (vi->decl) == PARM_DECL
|| TREE_CODE (vi->decl) == RESULT_DECL)
{
subvar_t sv;
if (var_can_have_subvars (vi->decl)
&& get_subvars_for_var (vi->decl))
&& (sv = get_subvars_for_var (vi->decl)))
{
/* If VI->DECL is an aggregate for which we created
SFTs, add the SFT corresponding to VI->OFFSET. */
tree sft = get_subvar_at (vi->decl, vi->offset);
SFTs, add the SFT corresponding to VI->OFFSET.
If we didn't do field-sensitive PTA we need to to
add all overlapping SFTs. */
unsigned int j;
tree sft = get_first_overlapping_subvar (sv, vi->offset,
vi->size, &j);
gcc_assert (sft);
if (sft)
for (; VEC_iterate (tree, sv, j, sft); ++j)
{
if (SFT_OFFSET (sft) > vi->offset
&& vi->size <= SFT_OFFSET (sft) - vi->offset)
break;
var_alias_set = get_alias_set (sft);
if (no_tbaa_pruning
|| (!is_derefed && !vi->directly_dereferenced)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment