avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] avr-gcc bug


From: Denis Chertykov
Subject: Re: [avr-gcc-list] avr-gcc bug
Date: 21 Apr 2001 21:58:11 +0400

"Francisco T. A. Silva" <address@hidden> writes:

> Hi all,
> 
> I=B4ve come upon the following bug.
> 
> The code:
> 
> int main(void)
> {
>     unsigned int i;
>     for(i = 31533; i > 0; i--);
> }

[...]

> 
> This bug apears with -Os, -O2, -O3. It seems from now on I=B4m restricted
> to -O :(.

It's not a bug.
GCC optimize dead loops. Really GCC can even remove such loops.

Try following code:

int foo (int);

int main(void)
{
    unsigned int i;
    for(i = 31533; i > 0; i--)
      foo(i);
}






reply via email to

[Prev in Thread] Current Thread [Next in Thread]