Patchwork [tree-ssa-structalias.c] : Small finding in find_func_aliases function

login
register
mail settings
Submitter Kai Tietz
Date April 5, 2013, 8:29 a.m.
Message ID <CAEwic4aLV-10e3XVxraLyr84J7ji_=m6PFVm04YozQ1x_URxsw@mail.gmail.com>
Download mbox | patch
Permalink /patch/234065/
State New
Headers show

Comments

Kai Tietz - April 5, 2013, 8:29 a.m.
Hello,

while debugging I made the finding that in find_func_aliases rhsop
might be used as NULL for gimple_assign_single_p items.  It should be
using for the gimple_assign_single_p instead directly the rhs1-item as
argument to pass to get_constraint_for_rhs function.

ChangeLog

2013-04-05  Kai Tietz

        * tree-ssa-structalias.c (find_func_aliases): Special-case
        gimple_assign_single_p handling.

Ok for apply?

Regards,
Kai
Jeff Law - April 5, 2013, 7:30 p.m.
On 04/05/2013 02:29 AM, Kai Tietz wrote:
> Hello,
>
> while debugging I made the finding that in find_func_aliases rhsop
> might be used as NULL for gimple_assign_single_p items.  It should be
> using for the gimple_assign_single_p instead directly the rhs1-item as
> argument to pass to get_constraint_for_rhs function.
>
> ChangeLog
>
> 2013-04-05  Kai Tietz
>
>          * tree-ssa-structalias.c (find_func_aliases): Special-case
>          gimple_assign_single_p handling.
>
> Ok for apply?
Yes.  OK for the trunk.

Do you have a testcase?

jeff
Richard Guenther - April 8, 2013, 9:06 a.m.
On Fri, Apr 5, 2013 at 9:30 PM, Jeff Law <law@redhat.com> wrote:
> On 04/05/2013 02:29 AM, Kai Tietz wrote:
>>
>> Hello,
>>
>> while debugging I made the finding that in find_func_aliases rhsop
>> might be used as NULL for gimple_assign_single_p items.  It should be
>> using for the gimple_assign_single_p instead directly the rhs1-item as
>> argument to pass to get_constraint_for_rhs function.
>>
>> ChangeLog
>>
>> 2013-04-05  Kai Tietz
>>
>>          * tree-ssa-structalias.c (find_func_aliases): Special-case
>>          gimple_assign_single_p handling.
>>
>> Ok for apply?
>
> Yes.  OK for the trunk.
>
> Do you have a testcase?

He can't because the analysis is wrong.  GIMPLE_SINGLE_RHS have exactly
two operands thus rhsop is always gimple_assign_rhs1 ().  So the patch
only un-CSEs gimple_assign_rhs1 ().

The is_gimple_assign () case can surely be re-worked to be easier to read
but the patch doesn't improve things.

Please revert it.

Thanks,
Richard.


> jeff
>
Kai Tietz - April 8, 2013, 9:11 a.m.
I haven't even applied it.

Kai

Patch

Index: tree-ssa-structalias.c
===================================================================
--- tree-ssa-structalias.c      (Revision 197495)
+++ tree-ssa-structalias.c      (Arbeitskopie)
@@ -4667,9 +4667,10 @@  find_func_aliases (gimple origt)
            }
          else if ((CONVERT_EXPR_CODE_P (code)
                    && !(POINTER_TYPE_P (gimple_expr_type (t))
-                        && !POINTER_TYPE_P (TREE_TYPE (rhsop))))
-                  || gimple_assign_single_p (t))
+                        && !POINTER_TYPE_P (TREE_TYPE (rhsop)))))
            get_constraint_for_rhs (rhsop, &rhsc);
+         else if (gimple_assign_single_p (t))
+           get_constraint_for_rhs (gimple_assign_rhs1 (t), &rhsc);
          else if (code == COND_EXPR)
            {
              /* The result is a merge of both COND_EXPR arms.  */