BR 2420167: jmp not always optimized
authorVictor van den Elzen <victor.vde@gmail.com>
Mon, 23 Feb 2009 03:35:00 +0000 (23 04:35 +0100)
committerVictor van den Elzen <victor.vde@gmail.com>
Mon, 23 Feb 2009 03:35:00 +0000 (23 04:35 +0100)
Begin by assuming short jumps are possible to prevent suboptimal convergence.

assemble.c

index ad7ea70..748e62f 100644 (file)
@@ -262,6 +262,11 @@ static bool jmp_match(int32_t segment, int64_t offset, int bits,
        return false;
 
     isize = calcsize(segment, offset, bits, ins, code);
+
+    if (ins->oprs[0].segment == NO_SEG)
+        /* Be optimistic in pass 1 */
+        return true;
+
     if (ins->oprs[0].segment != segment)
         return false;