This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Infinite number of iterations in loop [v850, mep]


> -----Original Message-----
> From: Andrew Haley [mailto:aph@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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]