fix wrong panic
authorMatthias Braun <matze@braunis.de>
Fri, 8 Jun 2007 18:25:57 +0000 (18:25 +0000)
committerMatthias Braun <matze@braunis.de>
Fri, 8 Jun 2007 18:25:57 +0000 (18:25 +0000)
[r14386]

ir/be/bespilldaemel.c

index eecc357..0d0bbd8 100644 (file)
@@ -203,15 +203,15 @@ void do_spilling(daemel_env_t *env, ir_nodeset_t *nodes, ir_node *node)
        /* spill cheapest ones */
        cand_idx = 0;
        while(spills_needed > 0) {
+               if(cand_idx >= node_count) {
+                       panic("can't spill enough values for node %+F\n", node);
+               }
+
                spill_candidate_t *candidate = &candidates[cand_idx];
                ir_node           *cand_node = candidate->node;
                int                is_use;
                ++cand_idx;
 
-               if(cand_idx >= node_count) {
-                       panic("can't spill enough values for node %+F\n", node);
-               }
-
                /* make sure the node is not a use of the instruction */
                is_use = 0;
                for(i = 0; i < arity; ++i) {