On Wed, Apr 20, 2016 at 5:08 PM, Bin Cheng <bin.ch...@arm.com> wrote:
> Hi,
> As reported in PR70715, GCC failed to prove no-overflows of IV(&p[n]) for 
> simple example like:
> int
> foo (char *p, unsigned n)
> {
>   while(n--)
>     {
>       p[n]='A';
>     }
>   return 0;
> }
> Actually, code has already been added to handle this form loops when fixing 
> PR68529.  Problem with this case is loop niter analyzer records control_IV 
> with its base expanded by calling expand_simple_operations.  This patch 
> simply adds code expanding BASE before we check its equality against 
> control_IV.base.  In the long run, we might want to remove the use of 
> expand_simple_operations.
>
> Bootstrap and test on x86_64.  Is it OK?

Ok.

Richard.

> Thanks,
> bin
>
>
> 2016-04-20  Bin Cheng  <bin.ch...@arm.com>
>
>         PR tree-optimization/70715
>         * tree-ssa-loop-niter.c (loop_exits_before_overflow): Check equality
>         after expanding BASE using expand_simple_operations.

Reply via email to