On Mon, May 30, 2016 at 2:35 AM, kugan
<kugan.vivekanandara...@linaro.org> wrote:
>
>
> On 28/05/16 01:28, Kugan Vivekanandarajah wrote:
>>
>> Hi Richard,
>>
>> This fix insertion point of stmt_to_insert based on your comments. In
>> insert_stmt_before_use , I now use find_insert_point such that we
>> insert the stmt_to_insert after its operands are defined. This means
>> that we now have to insert before and insert after in other cases.
>>
>> I also factored out uses of insert_stmt_before_use.
>>
>> I tested this with:
>> ./build/gcc/f951 cp2k_single_file.f90 -O3 -ffast-math -march=westmere
>>
>> I am running bootstrap and regression testing on x86-64-linux gnu. Is
>> this OK for trunk if the testing is fine ? I will also test with other
>> test cases from relevant PRs
>>
>>
> Hi,
>
> Here is the tested patch. I made a slight change to reflect the paten used
> everywhere else in reassoc.
>
> i.e., in insert_stmt_before_use, after finding the insertion point I now do:
>
> +  if (stmt == insert_point)
> +    gsi_insert_before (&gsi, stmt_to_insert, GSI_NEW_STMT);
> +  else
> +    insert_stmt_after (stmt_to_insert, insert_point);
>
> This is consistent with what is done in other places.
>
> I tested the patch with CPU2006 and bootstrapped and regression tested for
> x86-64-none-linux-gnu with no new regressions.
>
> Is this OK for trunk?

Ok.

Thanks,
Richard.

> Thanks,
> Kugan
>
> gcc/testsuite/ChangeLog:
>
> 2016-05-28  Kugan Vivekanandarajah  <kug...@linaro.org>
>
>         PR middle-end/71269
>         PR middle-end/71292
>         * gcc.dg/tree-ssa/pr71269.c: New test.
>         * gcc.dg/tree-ssa/pr71292.c: New test.
>
> gcc/ChangeLog:
>
> 2016-05-28  Kugan Vivekanandarajah  <kug...@linaro.org>
>
>         PR middle-end/71269
>         PR middle-end/71252
>
>         * tree-ssa-reassoc.c (insert_stmt_before_use): Use find_insert_point
> so
>         that inserted stmt will not dominate stmts that defines its operand.
>         (rewrite_expr_tree): Add stmt_to_insert before adding the use stmt.
>         (rewrite_expr_tree_parallel): Likewise.

Reply via email to