This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: How do i debug --no-inline or --full-tailcalls options?
- From: OKUMURA Yuki <mjt at cltn dot org>
- To: kawa at sourceware dot org
- Date: Fri, 12 Feb 2016 03:26:40 +0900
- Subject: Re: How do i debug --no-inline or --full-tailcalls options?
- Authentication-results: sourceware.org; auth=none
- References: <CAG1-Us1p_d+WdW6JRXyXYjafrmUBO1+1+2xAW4FSQjmepzMjGQ at mail dot gmail dot com> <56BC9451 dot 30002 at bothner dot com>
Ah, thanks for the comments!
2016-02-11 23:01 GMT+09:00 Per Bothner <per@bothner.com>:
- snip -
> Why do you want to use --no-inlining? One advantage I can see is beter
> stack traces (at least when --no-full-tailcalls). It might be reasonable to
> retrict --no-inlining's effect to "normal" functions.
Use of --no-inline is just because it (accidentally) solved another problem:
(https://github.com/okuoku/yuni/issues/34)
I don't fully understand what is happening on that issue yet;
with --full-tailcalls and without --no-inline,
Kawa seems to skip some procedures when its result is not
consumed at all. (ie. every skipped procedures were wrapper around SET!)
I prepared (somewhat) minified program which exhibits the problem:
https://gist.github.com/okuoku/d5cba6f31b781db911aa
The code prepares 2 vectors which hold some data but when
I move some setters into a R7RS library, these setters are
mysteriously "skipped" and a vector field would left uninitialized.
Without --full-tailcall nor --no-inline, it works fine:
$ java kawa.repl --r7rs check3.scm
(SET!-CALLED: 0 test)
(SET!-CALLED: 1 #<procedure testfunc>)
(SET!-CALLED: 0 #(test #<procedure testfunc>))
(SET!-CALLED: 1 (INIT1 . INIT2))
(#(test #<procedure testfunc>) ("INIT1" . "INIT2"))
but with --full-tailcall, a SET!-CALLED message is missing;
$ java kawa.repl --r7rs --full-tailcalls check3.scm
(SET!-CALLED: 0 test)
(SET!-CALLED: 1 #<procedure testfunc>)
(SET!-CALLED: 1 (INIT1 . INIT2))
("UNINITIALIZED_x" ("INIT1" . "INIT2"))
this means a line hereâ
(define (make-minidispatch-obj class param)
(let ((obj (make-minitype-obj)))
(baseset! obj 0 class) â
(baseset! obj 1 param)
obj))))
was skipped.
The problem is gone in case we added --no-inline:
$ java kawa.repl --r7rs --full-tailcalls --no-inline check3.scm
(SET!-CALLED: 0 test)
(SET!-CALLED: 1 #<procedure testfunc>)
(SET!-CALLED: 0 #(test #<procedure testfunc>))
(SET!-CALLED: 1 (INIT1 . INIT2))
(#(test #<procedure testfunc>) ("INIT1" . "INIT2"))
This is why I ended up specifying --no-inline.
I suspect this behaviour is backend's problem since when I merged
explicit libraries into a module, problem would just disappear.