lower_switch: fix bug in normalisation
authorMatthias Braun <matze@braunis.de>
Thu, 3 Nov 2011 17:43:49 +0000 (18:43 +0100)
committerMatthias Braun <matze@braunis.de>
Thu, 3 Nov 2011 17:44:00 +0000 (18:44 +0100)
ir/lower/lower_switch.c

index 800312e..2b78061 100644 (file)
@@ -229,8 +229,8 @@ static void normalize_switch(switch_info_t *info)
                min_const = new_r_Const(irg, delta);
                selector  = new_rd_Sub(dbgi, block, selector, min_const, mode);
 
-               info->switch_min  = 0;
                info->switch_max -= info->switch_min;
+               info->switch_min  = 0;
        }
 
        if (delta != NULL || change_mode) {