This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RE: Infinite number of iterations in loop [v850, mep]
- From: "Paulo Matos" <pmatos at broadcom dot com>
- To: "Andrew Haley" <aph at redhat dot com>
- Cc: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Wed, 13 Nov 2013 16:14:08 +0000
- Subject: RE: Infinite number of iterations in loop [v850, mep]
- Authentication-results: sourceware.org; auth=none
- References: <19EB96622A777C4AB91610E763265F463A757B at SJEXCHMB14 dot corp dot ad dot broadcom dot com> <5283A108 dot 1020108 at redhat dot com>
> -----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