Commit d599b81f by Richard Henderson Committed by Richard Henderson

* c-semantics.c (genrtl_do_stmt): Special case do/while(0).

From-SVN: r37177
parent 1426f761
2000-10-31 Richard Henderson <rth@redhat.com>
* c-semantics.c (genrtl_do_stmt): Special case do/while(0).
2000-10-31 Nick Clifton <nickc@redhat.com> 2000-10-31 Nick Clifton <nickc@redhat.com>
* config/arm/unknown-elf.h (UNIQUE_SECTION_P): Do not allow * config/arm/unknown-elf.h (UNIQUE_SECTION_P): Do not allow
......
...@@ -480,19 +480,28 @@ void ...@@ -480,19 +480,28 @@ void
genrtl_do_stmt (t) genrtl_do_stmt (t)
tree t; tree t;
{ {
tree cond; tree cond = DO_COND (t);
emit_nop ();
emit_line_note (input_filename, lineno); /* Recognize the common special-case of do { ... } while (0) and do
expand_start_loop_continue_elsewhere (1); not emit the loop widgetry in this case. In particular this
avoids cluttering the rtl with dummy loop notes, which can affect
alignment of adjacent labels. */
if (cond == integer_zero_node)
expand_stmt (DO_BODY (t));
else
{
emit_nop ();
emit_line_note (input_filename, lineno);
expand_start_loop_continue_elsewhere (1);
expand_stmt (DO_BODY (t)); expand_stmt (DO_BODY (t));
expand_loop_continue_here (); expand_loop_continue_here ();
cond = expand_cond (cond);
cond = expand_cond (DO_COND (t)); emit_line_note (input_filename, lineno);
emit_line_note (input_filename, lineno); expand_exit_loop_if_false (0, cond);
expand_exit_loop_if_false (0, cond); expand_end_loop ();
expand_end_loop (); }
} }
/* Build the node for a return statement and return it. */ /* Build the node for a return statement and return it. */
......
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