Fix iterating all irgs in gc_irgs().
authorChristoph Mallon <christoph.mallon@gmx.de>
Tue, 30 Oct 2012 07:10:40 +0000 (08:10 +0100)
committerChristoph Mallon <christoph.mallon@gmx.de>
Tue, 30 Oct 2012 07:10:40 +0000 (08:10 +0100)
Do not leave out the last (highest numbered) irg.

ir/opt/ircgopt.c

index d49701b..ce9e411 100644 (file)
@@ -121,7 +121,7 @@ void gc_irgs(size_t n_keep, ir_entity ** keep_arr)
        }
 
        /* clean */
-       for (size_t i = get_irp_n_irgs()-1; i-- > 0; ) {
+       for (size_t i = get_irp_n_irgs(); i-- != 0;) {
                ir_graph  *irg = get_irp_irg(i);
                ir_entity *ent = get_irg_entity(irg);