Commit c2a26505 by Gerald Pfeifer Committed by Gerald Pfeifer

gcc.texi (Non-bugs): ``Empty'' loops will be optimized away in the future...

	* gcc.texi (Non-bugs): ``Empty'' loops will be optimized away in
	the future; indeed that already happens in some cases.

From-SVN: r24442
parent 30dfe54a
Mon Dec 28 19:26:32 1998 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
* gcc.texi (Non-bugs): ``Empty'' loops will be optimized away in
the future; indeed that already happens in some cases.
Tue Dec 29 11:58:53 1998 Richard Henderson <rth@cygnus.com> Tue Dec 29 11:58:53 1998 Richard Henderson <rth@cygnus.com>
* sparc.c (input_operand): Recognize (const (constant_p_rtx)). * sparc.c (input_operand): Recognize (const (constant_p_rtx)).
......
...@@ -2005,12 +2005,18 @@ test explicitly for C++ as well. ...@@ -2005,12 +2005,18 @@ test explicitly for C++ as well.
@item @item
Deleting ``empty'' loops. Deleting ``empty'' loops.
GNU CC does not delete ``empty'' loops because the most likely reason Historically, GNU CC has not deleted ``empty'' loops under the
you would put one in a program is to have a delay. Deleting them will assumption that the most likely reason you would put one in a program is
not make real programs run any faster, so it would be pointless. to have a delay, so deleting them will not make real programs run any
faster.
It would be different if optimization of a nonempty loop could produce
an empty one. But this generally can't happen. However, the rationale here is that optimization of a nonempty loop
cannot produce an empty one, which holds for C but is not always the
case for C++.
Moreover, with @samp{-funroll-loops} small ``empty'' loops are already
removed, so the current behavior is both sub-optimal and inconsistent
and will change in the future.
@item @item
Making side effects happen in the same order as in some other compiler. Making side effects happen in the same order as in some other compiler.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment