mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-14 05:12:38 -08:00
When inlining to save intermediate computations, the temporary variables are created with a C type that matches the value, not the expected destination of that value.
This commit is contained in:
parent
5dcb1f6ebc
commit
b8ce2506ed
1 changed files with 7 additions and 7 deletions
|
|
@ -31,15 +31,13 @@
|
|||
;;; The forth element is T if and only if the result value is a new Lisp
|
||||
;;; object, i.e., it must be explicitly protected against GBC.
|
||||
|
||||
(defun make-inline-temp-var (expected-type value-type &optional loc)
|
||||
(let ((out-rep-type (lisp-type->rep-type expected-type)))
|
||||
(defun make-inline-temp-var (expected-type value-type &optional rep-type)
|
||||
(let ((out-rep-type (or rep-type (lisp-type->rep-type expected-type))))
|
||||
(if (eq out-rep-type :object)
|
||||
(make-temp-var)
|
||||
(let ((var (make-lcl-var :rep-type out-rep-type
|
||||
:type (type-and expected-type value-type))))
|
||||
(if loc
|
||||
(wt-nl "{" (rep-type-name out-rep-type) " " var "=" loc ";")
|
||||
(wt-nl "{" (rep-type-name out-rep-type) " " var ";"))
|
||||
(wt-nl "{" (rep-type-name out-rep-type) " " var ";")
|
||||
(incf *inline-blocks*)
|
||||
var))))
|
||||
|
||||
|
|
@ -47,7 +45,8 @@
|
|||
(let ((var (c1form-arg 0 form))
|
||||
(value-type (c1form-primary-type form)))
|
||||
(if (var-changed-in-form-list var rest-forms)
|
||||
(let* ((temp (make-inline-temp-var expected-type value-type)))
|
||||
(let* ((temp (make-inline-temp-var expected-type value-type
|
||||
(var-rep-type var))))
|
||||
(let ((*destination* temp)) (set-loc var))
|
||||
(list value-type temp))
|
||||
(list value-type var))))
|
||||
|
|
@ -66,7 +65,8 @@
|
|||
(return-type (c1form-primary-type form))
|
||||
(loc (call-global-loc fname nil args return-type expected-type))
|
||||
(type (loc-type loc))
|
||||
(temp (make-inline-temp-var expected-type type))
|
||||
(temp (make-inline-temp-var expected-type type
|
||||
(loc-representation-type loc)))
|
||||
(*destination* temp))
|
||||
(set-loc loc)
|
||||
(list type temp)))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue