[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Another inline compilation bug
Another bug:
Compiling this:
(defun x (c s i)
(declare (optimize (safety 2)))
(declare (fixnum i))
(setf (char s (setq i (1+ i))) c))
gives the result:
static L1()
{ register object *base=vs_base;
register object *sup=base+VM3;
vs_check;
{int V1;
V1=fix(base[2]);
vs_top=sup;
TTL:;
V1= (V1)+1;
base[3]= elt_set(base[1],V1,fix(base[0])); /* * */
vs_top=(vs_base=base+3)+1;
return;
}
}
In the line with the *, the argument "c" (base[0]) is incorrectly
coerced into a fixnum.
The problem is in cmpinline.lsp, in function inline-args.
Here's a context diff of the old and the fixed versions:
*** fix Tue Nov 1 20:07:02 1988
--- cmpinline.lsp Sat Apr 2 22:58:59 1988
***************
*** 179,185 ****
(t (setq forms (list* form
(list 'VAR (cadr form) vref)
(cdr forms)))
! (setq types (list* type types))))))
(t (let ((temp (list 'VS (vs-push))))
(let ((*value-to-go* temp)) (c2expr* form))
(push (coerce-loc temp type) locs))))))
--- 179,185 ----
(t (setq forms (list* form
(list 'VAR (cadr form) vref)
(cdr forms)))
! (setq types (list* type type types))))))
(t (let ((temp (list 'VS (vs-push))))
(let ((*value-to-go* temp)) (c2expr* form))
(push (coerce-loc temp type) locs))))))