Jan 23, 2012, 6:35:32 PM (8 years ago)

In X862-ALLOCATE-INITIALIZED-GVECTOR, we need to invalidate regmap
entries for values pushed and later popped into the vector.
(On x86, we arguably should invalidate the entry for the top of
stack whenever we push anything without going through X862-VPUSH-REGISTER;
we push stack markers, constants, and simple memory references. I didn't
do that.) If we push a value in a register to initialize a vector, don't
invalidate the location when it's popped/discarded, then push a constant
or memory reference, we might think that the register still contains the
stack location; this is the symptom described in


-Most- things that push and discard registers are associated with function
calls (which will invalidate the regmap). Inlined VECTOR is one exception;
I don't know if there are others.

1 edited


  • trunk/source/compiler/X86/x862.lisp

    r15156 r15172  
    865865      (setf (svref *x862-gpr-locations* gpr) (list loc)))
    866866    (setq *x862-gpr-locations-valid-mask*
    867           (logior *x862-gpr-locations-valid-mask* (ash 1 gpr)))))
     867          (logior *x862-gpr-locations-valid-mask* (ash 1 gpr)))))
    869869;;; For vpush: nothing else should claim to contain loc.
    19631963                    (x862-box-s64 seg target s64-reg)))))
    19641964             (t
    1965                 (with-imm-target () (u64-reg :u64)
    1966                   (if (eql vreg-mode hard-reg-class-gpr-mode-u64)
    1967                     (setq u64-reg vreg))
    1968                   (if (and index-known-fixnum (<= index-known-fixnum (arch::target-max-64-bit-constant-index arch)))
    1969                     (! misc-ref-c-u64 u64-reg src index-known-fixnum)
    1970                     (progn
    1971                       (if index-known-fixnum
    1972                         (x862-absolute-natural seg unscaled-idx nil (+ (arch::target-misc-data-offset arch) (ash index-known-fixnum 3))))
    1973                       (! misc-ref-u64 u64-reg src unscaled-idx)))
    1974                   (unless (eq u64-reg vreg)
    1975                     (ensuring-node-target (target vreg)
    1976                       (x862-box-u64 seg target u64-reg)))))))
     1965              (with-imm-target () (u64-reg :u64)
     1966                (if (eql vreg-mode hard-reg-class-gpr-mode-u64)
     1967                  (setq u64-reg vreg))
     1968                (if (and index-known-fixnum (<= index-known-fixnum (arch::target-max-64-bit-constant-index arch)))
     1969                  (! misc-ref-c-u64 u64-reg src index-known-fixnum)
     1970                  (progn
     1971                    (if index-known-fixnum
     1972                      (x862-absolute-natural seg unscaled-idx nil (+ (arch::target-misc-data-offset arch) (ash index-known-fixnum 3))))
     1973                    (! misc-ref-u64 u64-reg src unscaled-idx)))
     1974                (unless (eq u64-reg vreg)
     1975                  (ensuring-node-target (target vreg)
     1976                    (x862-box-u64 seg target u64-reg)))))))
    19771977          (t
    19781978           (unless is-1-bit
    54235423      (dolist (f initforms) (x862-form seg nil nil f))
    54245424      (let* ((*x862-vstack* *x862-vstack*)
     5425             (entry-vstack *x862-vstack*)
    54255426             (*x862-top-vstack-lcell* *x862-top-vstack-lcell*)
    54265427             (arch (backend-target-arch *target-backend*))
    54815482                         (! misc-set-c-node reg target index)))))
    54825483                 (! vstack-discard nntriv))
    5483                ))))
     5484               ))
     5485        (x862-regmap-note-vstack-delta entry-vstack *x862-vstack*)))
    54845486     (^)))
Note: See TracChangeset for help on using the changeset viewer.