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: [tree-ssa] Dce & infinite loops


On Mar 18, 2004, at 9:47 AM, Dale Johannesen wrote:

Of course this refers only to finite empty loops; infinite ones cannot
be removed, as several people have said.  (As a semi-practical
matter, you can use these to wait for an external signal from ^C
or the like.)

One cause of infinite loops is a common error:


while (!flag) { }

where flag should have been declared volatile.

For that reason, I'd like to see a warning when the compiler sees a trivially reduced infinite loop (L1: goto L1) in some later pass.

+------------------------------------------------------------+
| Alexander M. Rosenberg           <mailto:alexr@_spies.com> |
| Nobody cares what I say. Remove the underscore to mail me. |


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