This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PING: PR26197 (new_type_alias) fix
- From: Daniel Berlin <dannyb at google dot com>
- To: Dorit Nuzman <DORIT at il dot ibm dot com>
- Cc: Diego Novillo <dnovillo at redhat dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 09 Aug 2006 08:25:49 -0400
- Subject: Re: PING: PR26197 (new_type_alias) fix
- References: <OF5B394ED3.90DE18CE-ONC22571C4.007718E1-C22571C5.002AEB1C@il.ibm.com>
Dorit Nuzman wrote:
> Daniel Berlin <dannyb@google.com> wrote on 08/08/2006 11:14:27 AM:
>
>> Dorit Nuzman wrote:
>>> Daniel Berlin <dannyb@google.com> wrote on 07/08/2006 07:51:40 PM:
>>>
>>>> This is fine, thanks (though part of me wonders if it should only be
> the
>>>> way you describe *when* grouping has taken place, instead of always,
> but
>>>> you bootstrapped and tested it, so ...)
>>>>
>>> well, I bootstrapped without vectorization enabled, so I don't think
> this
>>> code was ever activated during bootstrap. I will bootstrap with
>>> vectorization enabled before I commit the patch.
>>>
>
> The patch passed bootstrap with vectorization enabled on i686.
>
>>> What do you meen by grouping?
>> So before the code did
>>
>> TAG <- new tag for ptr;
>> if (var has subvars){
>> foreach subvar
>> add the subvar as may-alias of TAG.
>> }
>> else{
>> get the may-aliases of var;
>> if (|may-aliases| == 1)
>> set the (single) may-alias of var as the new tag of ptr;
>> else if (|may-aliases| == 0)
>> add var as may-alias of the TAG;
>> else /* |may-aliases| > 1 */
>> add the may-aliases of var as may-aliases of TAG;
>> }
>> and now does
>>
>> TAG <- new tag for ptr;
>> if (var has subvars){
>> foreach subvar
>> add_may_aliases_for_new_tag (TAG, subvar)
>> }
>> else{
>> add_may_aliases_for_new_tag (TAG, var)
>> }
>>
>> add_may_aliases_for_new_tag (TAG, var)
>> {
>> get the may-aliases of var;
>> if (|may-aliases| == 1)
>> set the (single) may-alias of var as the new tag of ptr;
>> else if (|may-aliases| == 0)
>> add var as may-alias of the TAG;
>> else /* |may-aliases| > 1 */
>> add the may-aliases of var as may-aliases of TAG;
>> }
>>
>>
>> The difference between the two is that you used to add the subvars to
>> the tags, and now you add the the aliases of the subvars, presumably
>> because your subvars are marked as tags (what is now known as
>> "is_aliased" as of late).
>>
>> The main reason subvars get marked as tags is because of
>> 1. It is the target of some aliasing relationship
>>
>> 2. The alias grouping code, which ends up putting tags in the may-alias
>> list of other tags.
>>
>> if is_aliased is false on the subvars when you start new_type_alias, but
>> becomes true during it, it means you are adding subvars to a tag that
>> were never aliases of anything else before (or else they would have had
>> is_aliased set by add_may_alias).
>>
>> I'm not sure why you'd want to do this in case #1 *if is_aliased was
>> false* (unless you also just created those subvars, too), because if
>> they aren't part of an aliasing relationship, we had already determined
>> them to be not touched by a dereference.
>>
>> It is nuclear from the comments on the bugreport whether it was false
>> before new_type_alias started or not.
>>
>
> In the testcase, the is_aliased of the subvar in question is false... So,
> if I do the following instead of the above (i.e. change the behavior only
> if is_aliased is true), the test fails:
>
> if (var has subvars){
> foreach subvar
> if (subvar->is_aliased)
> add_may_aliases_for_new_tag (TAG, subvar) /* new behavior */
> else
> add the subvar as may-alias of TAG /* old behavior */
> }
> else{
> add_may_aliases_for_new_tag (TAG, var)
> }
>
Actually, it would be
> if (var has subvars){
> foreach subvar
> if (subvar->is_aliased)
> add_may_aliases_for_new_tag (TAG, subvar) /* new behavior */
> else
<skip this subvar>
> }
> else{
> add_may_aliases_for_new_tag (TAG, var)
> }
The point is that if is_aliased was false, it wasn't aliased in the
first place (IE not touched by any dereference), so unless you've
changed the program semantics, it still isn't