This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Fix PTA with lots of SFTs
On Wed, 14 Nov 2007, Daniel Berlin wrote:
> On 11/14/07, Richard Guenther <firstname.lastname@example.org> wrote:
> > The difference is ultimatively because points-to and operand scanning
> > disagree about whether they did field-sensitive analysis.
> When PTA doesn't do field sensitive analysis, it should have chosen to
> say the entire variable is pointed-to, because that is all it creates
> in the way of variable info.
> This should end up translating into all the SFT's in set_uids_in_ptset.
> That this is not happening is going to cause bugs elsewhere (in
> particular, when we collapse C++ variables because of weird front end
> issues), and your fix won't fix those.
> I see what is happening.
> This is a bug in set_uids_in_ptset. It's not taking into account that
> their may be more than one sft per var when
> MAX_FIELDS_FOR_FIELD_SENSITIVE is hit. It assumes if the variable has
> subvars, that we built separate vars for it (same problem you
> mentioned, different place).
> I think the right way to fix this is to take into account the size of
> the varinfo here:
> if (var_can_have_subvars (vi->decl)
> && 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);
> and make it into a loop so it gets all the subvars until it hits the
> size of the variable.
Yes, I think that makes sense. Though it probably also makes sense
to limit the number of SFTs we create for structures, so I'll check the
above on top of this patch. (otherwise in case we didn't do
field-sensitive analysis but created SFTs we'd always create large