Re: confused at code generation for a empty loop

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

 



PRC wrote:

>    while( flag == 0 ) ;

> I wonder why gcc generates code for a empty loop like that. Is it a bug or for optimization in some case?
> 
This subject has been debated at length, and some programmers rely on
the current gcc treatment.  More programmers rely on loops whose exit
condition should not be optimized away, but does get "optimized" away by
unsafe "optimizations" by certain compilers, including gcc -ffast-math.

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux