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]


On 11/13/2013 03:48 PM, Paulo Matos wrote:

> I cannot understand GCC's reasoning that the second loop is not
> simple. The only source code difference is that unsigned int b is
> extern. However, it will always be higher than 'a' (unsigned int)
> and the loop can't possibly be infinite.
> 
> Does anybody know why GCC is behaving this way?

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.


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