[tree-ssa] Dce & infinite loops

Alex Rosenberg alexr@spies.com
Thu Mar 18 21:45:00 GMT 2004


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. |



More information about the Gcc mailing list