On Fri, May 26, 2017 at 12:49 PM, Richard Biener
<[email protected]> wrote:
> On Thu, May 25, 2017 at 8:00 PM, Bin Cheng <[email protected]> wrote:
>> Hi,
>> I believe this tests has been wrongly modified previously. It is to test
>> that the exit check on
>> pointer shouldn't be replaced by integer IV. Somehow GCC starts replacing
>> the check on
>> integer IV with pointer IV. It's valid, though inefficient. And somehow we
>> starting checking
>> this iv replacement. This patch rectifies it by specifically checking the
>> check on pointer
>> shouldn't be replaced.
>
> So maybe it should then test that the pointer test prevails? Or
> rather that it doesn't replace
> any exit test? If 'p' changes for '_2' for unrelated reasons the
> pattern will be not testing what
> it is supposed to test...
Thanks for reviewing, I updated patch testing if condition on p_limit2
still exists before expanding. Is it OK?
Thanks,
bin
>
> Richard.
>
>> Bootstrap and test in series on x86_64. Is it OK?
>> Thanks,
>> bin
>> gcc/testsuite/ChangeLog
>> 2017-05-11 Bin Cheng <[email protected]>
>>
>> * gcc.dg/tree-ssa/ivopt_mult_4.c: Explicitly check comparison
>> on pointer should not be replaced.
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ivopt_mult_4.c
b/gcc/testsuite/gcc.dg/tree-ssa/ivopt_mult_4.c
index effb052..e69e416 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ivopt_mult_4.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ivopt_mult_4.c
@@ -1,6 +1,6 @@
/* { dg-do compile { target {{ i?86-*-* x86_64-*-* } && lp64 } } } */
-/* { dg-options "-O2 -m64 -fdump-tree-ivopts-details" } */
+/* { dg-options "-O2 -m64 -fdump-tree-optimized" } */
/* iv i's step 16 so its period is smaller than the max iterations
* i.e. replacing if (p2 > p_limit2) with testing of i may result in
@@ -21,4 +21,4 @@ long foo(long* p, long* p2, int N1, int N2)
return s;
}
-/* { dg-final { scan-tree-dump "Replacing exit test" "ivopts"} } */
+/* { dg-final { scan-tree-dump "if \\(.*p_limit2.*\\)" "optimized"} } */