X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fcompiler%2Fassem.lisp;h=dfb1275d8f5ea9381de83724ca3280aa0d9e35b2;hb=f79e7df41edd15a68c763263a81e7c640005a60b;hp=401d9a509e9c00ddcf72be8f40688be916b8de25;hpb=b916eedb42ae51b5069f8e2b210649b897b2ec24;p=sbcl.git diff --git a/src/compiler/assem.lisp b/src/compiler/assem.lisp index 401d9a5..dfb1275 100644 --- a/src/compiler/assem.lisp +++ b/src/compiler/assem.lisp @@ -910,14 +910,14 @@ (offset (- (segment-current-posn segment) (segment-sync-posn segment)))) (cond ((> bits alignment) - ;; We need more bits of alignment. First emit enough noise - ;; to get back in sync with alignment, and then emit an - ;; alignment note to cover the rest. - (let ((slop (logand offset (1- (ash 1 alignment))))) - (unless (zerop slop) - (emit-skip segment (- (ash 1 alignment) slop) pattern))) - (let ((size (logand (1- (ash 1 bits)) - (lognot (1- (ash 1 alignment)))))) + ;; We need more bits of alignment. Emit an alignment note. + ;; The ALIGNMENT many least significant bits of (- OFFSET) + ;; give the amount of bytes to skip to get back in sync with + ;; ALIGNMENT, and one-bits to the left of that up to position + ;; BITS provide the remaining amount. + (let ((size (deposit-field (- offset) + (byte 0 alignment) + (1- (ash 1 bits))))) (aver (> size 0)) (emit-annotation segment (make-alignment bits size pattern)) (emit-skip segment size pattern))