]> git.unchartedbackwaters.co.uk Git - francis/libjit.git/commitdiff
fix problem with moving blocks that go just after init_block
authorAleksey Demakov <ademakov@gmail.com>
Wed, 12 Jul 2006 16:43:03 +0000 (16:43 +0000)
committerAleksey Demakov <ademakov@gmail.com>
Wed, 12 Jul 2006 16:43:03 +0000 (16:43 +0000)
ChangeLog
jit/jit-insn.c

index 0792140e3e3418def0948255f402e2f02487aeb1..fab1de6378d5b97c31ec00861f5dbc86e63b30c5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-07-12  Aleksey Demakov  <ademakov@gmail.com>
+
+       * jit/jit-insn.c (jit_insn_move_blocks_to_start): fix problem with
+       wrong order of blocks that were moved from the position just after
+       the init_block and with disappearance of blocks after the empty
+       init_block.
+
 2006-07-06  Aleksey Demakov  <ademakov@gmail.com>
 
        * jit/jit-rules-x86.ins: fix division by power of two.
index 85c2fedf98c1fe649b02b6e4ec81f6f071f09074..fa37ecb14c7872bac76ac32784606f72596244ea 100644 (file)
@@ -7958,9 +7958,15 @@ int jit_insn_move_blocks_to_start
                func->builder->init_insn = -1;
        }
 
-       /* If the first block is just after "init_block", then nothing to do */
-       if(init_block->next == first_block)
+       /* If the first block is just after "init_block", then only move
+          the init_block pointer ahead */
+       if(init_block == first_block || init_block->next == first_block)
        {
+               while(init_block != 0 && init_block->label != to_label)
+               {
+                       init_block = init_block->next;
+               }
+               func->builder->init_block = init_block;
                return 1;
        }