This is the mail archive of the gcc-patches@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: [Fwd: Re: [doc] empty loops]


On Tuesday, November 30, 2004, at 08:31 AM, Nathan Sidwell wrote:
I confused myself with the example.  I meant it to point out that
even non-empty C loops can be optimized to empty ones.  How about this
adjusted wording that leaves it open to when such loops actually get
deleted.

! Be aware of this when performing timing tests, for instance the
! following loop can be completely removed, provided
! @code{some_expression} can provably not change any global state.

Well, since we are into the word smithing now, I might as well point out that that isn't guarantee that the loop will not be removed. volatile int i; ++i; is in short one of the few things that might not be removed. Consider -fwhole-program and the direction Kenny wants to go.



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