From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 35445 invoked by alias); 11 Feb 2016 14:02:34 -0000 Mailing-List: contact kawa-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: kawa-owner@sourceware.org Received: (qmail 35421 invoked by uid 89); 11 Feb 2016 14:02:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1941, beter, tied X-HELO: aibo.runbox.com Received: from aibo.runbox.com (HELO aibo.runbox.com) (91.220.196.211) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Thu, 11 Feb 2016 14:02:18 +0000 Received: from [10.9.9.207] (helo=mailfront03.runbox.com) by bars.runbox.com with esmtp (Exim 4.71) (envelope-from ) id 1aTroz-0006ss-5O; Thu, 11 Feb 2016 15:02:13 +0100 Received: from 70-36-239-75.dsl.dynamic.fusionbroadband.com ([70.36.239.75] helo=toshie.bothner.com) by mailfront03.runbox.com with esmtpsa (uid:757155 ) (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.76) id 1aTroi-0005m6-UB; Thu, 11 Feb 2016 15:01:57 +0100 Subject: Re: How do i debug --no-inline or --full-tailcalls options? To: OKUMURA Yuki , kawa@sourceware.org References: From: Per Bothner Message-ID: <56BC9451.30002@bothner.com> Date: Thu, 11 Feb 2016 14:02:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2016-q1/txt/msg00009.txt.bz2 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 > # 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/