A do-while loop is nicer than a for loop here.
authorChristoph Mallon <christoph.mallon@gmx.de>
Fri, 19 Oct 2007 18:00:44 +0000 (18:00 +0000)
committerChristoph Mallon <christoph.mallon@gmx.de>
Fri, 19 Oct 2007 18:00:44 +0000 (18:00 +0000)
[r16284]

ir/be/belower.c

index f2dd1d4..3be7fda 100644 (file)
@@ -761,9 +761,10 @@ static void melt_copykeeps(constraint_env_t *cenv) {
                                ir_nodeset_insert(&entry->copies, new_ck);
 
                                /* find scheduling point */
-                               for (sched_pt = sched_next(ref_mode_T); be_is_Keep(sched_pt) || be_is_CopyKeep(sched_pt); sched_pt = sched_next(sched_pt)) {
+                               do {
                                        /* just walk along the schedule until a non-Keep/CopyKeep node is found */
-                               }
+                                       sched_pt = sched_next(ref_mode_T);
+                               } while (be_is_Keep(sched_pt) || be_is_CopyKeep(sched_pt));
 
                                sched_add_before(sched_pt, new_ck);
                                DBG((cenv->dbg, LEVEL_1, "created %+F, scheduled before %+F\n", new_ck, sched_pt));