------- Comment #13 from dberlin at gcc dot gnu dot org  2009-02-04 16:09 
-------
Subject: Re:  PTA constraint processing for *x = 
        y is wrong

I don't remember offhand.  At one point during 4.2 we used to compute
the anything set exactly, and it led to massive issues. Of course,
most of those were because the anything set had hundreds or thousands
of SFT's :).

I'm happy to go with your idea for fixing since fixing shortcutting
won't fix it, except for two things:
1. ANYTHING is really limited to all addressable variables (IE address
taken and escaping), instead of all variables.  It was never meant to
represent "completely unknown" (IE user has set pointer to  (char *)
0xdeadbeef).
ISTM the set you union in should be based on CALLUSED and ESCAPED or
something thereof, or at least should be computable with constraints
during solving, and unioned in when it changes.

The way off the top of my head to do this is to simply stop using
&ANYTHING, and use ANYTHING directly, and then have ANYTHING =
CALLUSED and ANYTHING = ESCAPED.

Assuming you hate that idea for some reason
2. It's probably a lot faster to make a bitmap of these and update it,
then union in the bitmap, than to iterate over all varinfos all the
time.

ISTM you are trying to avoid doing #1 by adding all variables, even
though this is going to give you worse than necessary results.

Intel actually iterates points-to solving in order to compute the set
of nonlocal locations without explicitly adding the set everywhere.

See the description of nloc in section 4.1 of  "On the Importance of
Points=To Analysis and Other
Memory Disambiguation Methods For C Programs"

On Wed, Feb 4, 2009 at 4:35 AM, rguenther at suse dot de
<gcc-bugzi...@gcc.gnu.org> wrote:
>
>
> ------- Comment #8 from rguenther at suse dot de  2009-02-04 09:35 -------
> Subject: Re:  PTA constraint processing for *x
>  = y is wrong
>
> On Wed, 4 Feb 2009, dberlin at dberlin dot org wrote:
>
>> ------- Comment #7 from dberlin at gcc dot gnu dot org  2009-02-04 00:29 
>> -------
>> Subject: Re:  PTA constraint processing for *x =
>>         y is wrong
>>
>> On Tue, Feb 3, 2009 at 9:24 AM, rguenther at suse dot de
>> <gcc-bugzi...@gcc.gnu.org> wrote:
>> >
>> >
>> > ------- Comment #6 from rguenther at suse dot de  2009-02-03 14:24 -------
>> > Subject: Re:  PTA constraint processing for *x
>> >  = y is wrong
>> >
>> > On Tue, 3 Feb 2009, dberlin at dberlin dot org wrote:
>> >
>> >> Subject: Re:  PTA constraint processing for *x =
>> >>         y is wrong
>> >>
>> >> There used to be a *ANYTHING = ANYTHING constraint + ANYTHING
>> >> containing all the variables pointing to ANYTHING that would have
>> >> taken care of this.
>> >> You certainly don't want to dynamically add all variables at solving
>> >> time yourself, since that can't be optimized.
>> >
>> > This is the reason it "works" for ESCAPED, there we have an
>> > *ESCAPED = ESCAPED constraint.  It doesn't work for CALLUSED though,
>> > I have a simple fix (CALLUSED is not big usually, so just not using
>> > it as a placeholder fixes the issue here).
>> >
>> > For the ANYTHING problem I have just dealt with it in do_ds_constraint
>> > (I'll post an updated patch soon after testing finished).
>>
>> My onl concern is practicality.
>> The last time I did this solely at solving time it was ridiculously
>> slow on large cases, since the solver is much better at difference
>> propagation.
>
> Do you remember what testcase(s) this was?  I can certainly time
> removing the shortcutting against handling *ANYTHING (and I'll try
> to come up with a testcase that is not fixed with just removing
> the shortcutting).
>
> Richard.
>
>
> --
>
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39074
>
> ------- You are receiving this mail because: -------
> You are on the CC list for the bug, or are watching someone who is.
>


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39074

Reply via email to