From d10fd598317d125059cf7223091573f9004261b8 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 19 Feb 2019 20:03:55 -0800 Subject: compiler: prof instruction tries to modify t0. * share/txr/stdlib/compiler.tl (compiler comp-prof): We must use the incoming oreg as the destination for prof, and not try to use output register indicated by the compiled fragment. That fragment may indicate nil as its output, which we may not clobber. Since we are telling the sub-compile to try to put the fragment's output into our oreg, in most cases they still get merged so a single register is re-used. --- share/txr/stdlib/compiler.tl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/txr/stdlib/compiler.tl b/share/txr/stdlib/compiler.tl index da49c873..c68d0f14 100644 --- a/share/txr/stdlib/compiler.tl +++ b/share/txr/stdlib/compiler.tl @@ -1239,8 +1239,8 @@ (defmeth compiler comp-prof (me oreg env form) (mac-param-bind form (op . forms) form (let ((bfrag me.(comp-progn oreg env forms))) - (new (frag bfrag.oreg - ^((prof ,bfrag.oreg) + (new (frag oreg + ^((prof ,oreg) ,*bfrag.code (end ,bfrag.oreg)) bfrag.fvars bfrag.ffuns))))) -- cgit v1.2.3