summaryrefslogtreecommitdiff
path: root/gcc/c-semantics.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/c-semantics.c')
-rw-r--r--gcc/c-semantics.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/gcc/c-semantics.c b/gcc/c-semantics.c
index 994b4625da5..0b8f5870134 100644
--- a/gcc/c-semantics.c
+++ b/gcc/c-semantics.c
@@ -23,6 +23,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "tree.h"
#include "function.h"
#include "splay-tree.h"
@@ -455,6 +457,17 @@ genrtl_do_stmt (t)
expand_stmt (DO_BODY (t));
expand_end_null_loop ();
}
+ else if (integer_nonzerop (cond))
+ {
+ emit_nop ();
+ emit_line_note (input_filename, lineno);
+ expand_start_loop (1);
+
+ expand_stmt (DO_BODY (t));
+
+ emit_line_note (input_filename, lineno);
+ expand_end_loop ();
+ }
else
{
emit_nop ();
@@ -519,7 +532,10 @@ genrtl_for_stmt (t)
/* Expand the initialization. */
emit_nop ();
emit_line_note (input_filename, lineno);
- expand_start_loop_continue_elsewhere (1);
+ if (FOR_EXPR (t))
+ expand_start_loop_continue_elsewhere (1);
+ else
+ expand_start_loop (1);
genrtl_do_pushlevel ();
cond = expand_cond (FOR_COND (t));
@@ -541,9 +557,11 @@ genrtl_for_stmt (t)
input_filename = saved_filename;
lineno = saved_lineno;
emit_line_note (input_filename, lineno);
- expand_loop_continue_here ();
if (FOR_EXPR (t))
- genrtl_expr_stmt (FOR_EXPR (t));
+ {
+ expand_loop_continue_here ();
+ genrtl_expr_stmt (FOR_EXPR (t));
+ }
expand_end_loop ();
}