From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Mikael Djurfeldt Newsgroups: gmane.lisp.guile.devel Subject: Re: GMP code committed -- watch for bugs. Date: Sun, 06 Apr 2003 11:16:44 +0200 Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: References: <87he9dhoxh.fsf@raven.i.defaultvalue.org> Reply-To: djurfeldt@nada.kth.se NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1049620694 26105 80.91.224.249 (6 Apr 2003 09:18:14 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 6 Apr 2003 09:18:14 +0000 (UTC) Cc: djurfeldt@nada.kth.se Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sun Apr 06 11:18:11 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1926Hz-0006mu-00 for ; Sun, 06 Apr 2003 11:18:11 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 1926HL-00078R-05 for guile-devel@m.gmane.org; Sun, 06 Apr 2003 05:17:31 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 1926Gt-0006Pk-00 for guile-devel@gnu.org; Sun, 06 Apr 2003 05:17:03 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 1926Gj-00068q-00 for guile-devel@gnu.org; Sun, 06 Apr 2003 05:16:54 -0400 Original-Received: from kvast.blakulla.net ([213.212.20.77]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 1926Gd-0005yT-00 for guile-devel@gnu.org; Sun, 06 Apr 2003 05:16:47 -0400 Original-Received: from barbara.blakulla.net ([213.212.21.238] helo=linnaeus) by kvast.blakulla.net with esmtp (Exim 3.36 #1 (Debian)) id 1926Gb-00059B-00; Sun, 06 Apr 2003 11:16:45 +0200 Original-Received: from mdj by linnaeus with local (Exim 3.36 #1 (Debian)) id 1926Ga-0002J9-00; Sun, 06 Apr 2003 11:16:44 +0200 Original-To: Rob Browning , guile-devel@gnu.org In-Reply-To: (Mikael Djurfeldt's message of "Sat, 05 Apr 2003 23:51:41 +0200") User-Agent: Gnus/5.090016 (Oort Gnus v0.16) Emacs/21.2 (gnu/linux) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Developers list for Guile, the GNU extensibility library List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.devel:2132 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:2132 Mikael Djurfeldt writes: > 2. My first attempt to build Guile has failed. check_sanity aborts at > the long_long LLONG_MAX test. Unfortunately, I can't look into > that right now. OK. There seems to be two bugs preventing the long_long tests from succeeding: 1. num2integral.i.c:INTEGRAL2BIG had a bug in computing the absolute value of n when preparing arguments to mpz_import. I've committed a fix for this. 2. The determination of required storage size for a bignum is buggy: ITYPE NUM2INTEGRAL (SCM num, unsigned long int pos, const char *s_caller) { [...] numbits = mpz_sizeinbase (SCM_I_BIG_MPZ (num), 2); if (UNSIGNED) numbits++; scm_remember_upto_here_1 (num); if (numbits > (sizeof (ITYPE) * 8)) scm_out_of_range (s_caller, num); Firstly, you probably intended to write "if (!UNSIGNED)" (to make room for the sign bit). Secondly, that doesn't work either. For example, the absolute value of LLONG_MIN requires 64 bits, even though it is a signed number. So, regardless if we have "if (UNSIGNED)" or "if (!UNSIGNED)" there will always be a case where a valid long_long or ulong_long will cause an out_of_range error. Unfortunately, I don't have time to get enough overview of the situation to fix this bug. I'll leave that to you. Best regards, Mikael _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel