public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
From: Per Bothner <per@bothner.com>
To: OKUMURA Yuki <mjt@cltn.org>, kawa@sourceware.org
Subject: Re: How do i debug --no-inline or --full-tailcalls options?
Date: Thu, 11 Feb 2016 14:02:00 -0000	[thread overview]
Message-ID: <56BC9451.30002@bothner.com> (raw)
In-Reply-To: <CAG1-Us1p_d+WdW6JRXyXYjafrmUBO1+1+2xAW4FSQjmepzMjGQ@mail.gmail.com>



On 02/11/2016 12:51 AM, OKUMURA Yuki wrote:

> EXAMPLE1: --full-tailcalls
> (https://github.com/okuoku/yuni/issues/33)
>
> Following program requires --full-tailcalls to run with "java
> kawa.repl -r7rs prog.sps".
> Otherwise, Kawa gives java.lang.VerifyError.
>
> (import (scheme base))
>
> (define (ssplit-parse-byte0-ORIG byte)
>    (case byte
>      ((NONE) (values 'NONE #f))
>      (else (values 'OTHERS #f))))
>
> Why do we need --full-tailcalls here?
> Removing CASE should compile fine so I guess there's something
> different around (scheme base)
> exported VALUES procedure here..

It looks like a bug relating to type-inference and related
code-generation.  I'll look into it tomorrow.

> EXAMPLE2: --no-inline
> (https://github.com/okuoku/yuni/issues/35)
>
> Following program behaves differently with/without --no-inline option:
>
> (import (scheme base)
>          (scheme write)
>          (scheme eval))
>
> (let ((c (eval 'cons2 (environment '(rename (scheme base) (cons cons2))))))
>   (write c)(newline))
>
> With --no-inline option, EVAL will fail to bind renamed identifier so
> it will fail to execute:
>
> $ java kawa.repl --no-inline -r7rs check.sps
> unbound location: cons2
>
> Oddly, it is fine without --no-inline option:
>
> $ java kawa.repl -r7rs check.sps
> #<procedure cons>

I would generally avoid using --no-inline.   It is not very well specified
or as well tested.  One problem is that the type-inference machinery is tied
in with the inlining machinery.

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.

That said, I don't see any obvious reasons --no-inline shouldnt work in
this case, and if it's not too difficult it may be worth fixing. I'll take a look tomorrow.
-- 
	--Per Bothner
per@bothner.com   http://per.bothner.com/

  reply	other threads:[~2016-02-11 14:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-11  8:51 OKUMURA Yuki
2016-02-11 14:02 ` Per Bothner [this message]
2016-02-11 18:26   ` OKUMURA Yuki
2016-02-12 21:53     ` Per Bothner
2016-02-12  1:26 ` Per Bothner
2016-02-12  7:25   ` Per Bothner
2016-02-12 17:33     ` OKUMURA Yuki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56BC9451.30002@bothner.com \
    --to=per@bothner.com \
    --cc=kawa@sourceware.org \
    --cc=mjt@cltn.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).