> -----Original Message-----
> From: Andrew Haley [mailto:a...@redhat.com]
> Sent: 13 November 2013 15:56
> To: Paulo Matos
> Cc: gcc@gcc.gnu.org
> Subject: Re: Infinite number of iterations in loop [v850, mep]
> 
> On 11/13/2013 03:48 PM, Paulo Matos wrote:
>
> Because GCC does not know that *c++ = 0; will not overwrite b .  I
> suppose you could argue that it's not really infinite, because a will
> eventually equal 0xffffffff, but I think that's what is going on.
> 
> Andrew.
> 

I think you might be right, since this works:
extern int * __restrict c;
extern unsigned int * __restrict b;
void fn1 (void)
{
  unsigned int a;
  for (a = 0; a < *b; a++)
    *c++ = 0;
}

I will try to investigate further.

-- 
PMatos

Reply via email to