diff --git a/s/cpnanopass.ss b/s/cpnanopass.ss index 643c7ad191..7f54fd355a 100644 --- a/s/cpnanopass.ss +++ b/s/cpnanopass.ss @@ -668,12 +668,26 @@ (loop n)))) (set! frame-vars new-vec)))) (or (vector-ref frame-vars x) - (let ([fv ($make-fv x (constant-case stack-word-alignment - [(2) (if (and (eq? type 'fp) - (fxodd? x)) - 'ptr - type)] - [(1) type]))]) + (let ([fv ($make-fv x (let* ([type + ;; Don't allocate misaligned 'fp + (constant-case stack-word-alignment + [(2) (if (and (eq? type 'fp) + (fxodd? x)) + 'ptr + type)] + [(1) type])] + [type + ;; Don't allocate 'fp that overlaps + ;; an allocated slot + (constant-case ptr-bits + [(32) (let ([next-fv (and (fx< (fx+ x 1) (vector-length frame-vars)) + (vector-ref frame-vars (add1 x)))]) + (if (and next-fv + (not (eq? (fv-type next-fv) 'reserved))) + 'ptr + type))] + [(64) type])]) + type))]) (vector-set! frame-vars x fv) fv))])) (define get-ptr-fv diff --git a/s/x86.ss b/s/x86.ss index edeb6b8aca..25986f6dc1 100644 --- a/s/x86.ss +++ b/s/x86.ss @@ -824,7 +824,7 @@ `(asm ,info ,(asm-fl-load op (info-loadfl-flreg info)) ,x ,y ,z)]) (define-instruction value (fpt) - [(op (x fpur) (y ur)) `(asm ,info ,asm-fpt ,x ,y)]) + [(op (x fpur) (y ur)) `(set! ,(make-live-info) ,x (asm ,info ,asm-fpt ,y))]) (define-instruction value (fpmove) [(op (x fpmem) (y fpur)) `(set! ,(make-live-info) ,x (asm ,info ,asm-fpmove ,y))]