From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Andy Moreton Newsgroups: gmane.emacs.devel Subject: Re: bignum branch Date: Mon, 16 Jul 2018 23:28:30 +0100 Message-ID: <86tvoy3je9.fsf@gmail.com> References: <87o9fbbw1t.fsf@tromey.com> <86in5jdj49.fsf@gmail.com> <83wotxaiwi.fsf@gnu.org> <86k1pxmvmx.fsf@gmail.com> <87efg4a9xc.fsf@tromey.com> <87a7qr8cz7.fsf@tromey.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1531780038 4034 195.159.176.226 (16 Jul 2018 22:27:18 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 16 Jul 2018 22:27:18 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (windows-nt) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jul 17 00:27:14 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ffBxX-0000wO-VC for ged-emacs-devel@m.gmane.org; Tue, 17 Jul 2018 00:27:12 +0200 Original-Received: from localhost ([::1]:54334 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ffBze-0004dX-Ux for ged-emacs-devel@m.gmane.org; Mon, 16 Jul 2018 18:29:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37826) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ffBz2-0004dS-5J for emacs-devel@gnu.org; Mon, 16 Jul 2018 18:28:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ffByy-0008Kn-VO for emacs-devel@gnu.org; Mon, 16 Jul 2018 18:28:44 -0400 Original-Received: from [195.159.176.226] (port=41076 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ffByy-0008KX-JH for emacs-devel@gnu.org; Mon, 16 Jul 2018 18:28:40 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1ffBwp-0008WI-50 for emacs-devel@gnu.org; Tue, 17 Jul 2018 00:26:27 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 207 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:a9qb5VhorKROmFsxqQVA4gyNpTU= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:227487 Archived-At: On Mon 16 Jul 2018, Tom Tromey wrote: >>>>>> "Tom" == Tom Tromey writes: > > Tom> I was thinking this is what I' have emacs do when > Tom> sizeof(EMACS_INT) > sizeof(long). > > Please try this patch. > > Unfortunately I don't know how I can test it locally This builds ok on Windows with 64bit mingw64 (MSYS2), but still has a few issues and some odd behaviour: - Some GCC warnings - A selection of marker related issues - A problem with the ccl.el compiler for CCL programs - Some test failures - eassert() failures in make_bignum_str() during tests. Possible issues are that its caller, string_to_number() does not appear to handle the S2N_IGNORE_TRAILING flag for arguments that end up as bignums. It is also possible that string_to_number() has slightly different semantics for its `base' argument from mpz_set_str(). 1) Some GCC warnings: C:/emacs/git/emacs/bignum/src/search.c: In function 'Freplace_match': C:/emacs/git/emacs/bignum/src/search.c:2651:15: warning: argument 1 value '2305843009213693951' exceeds maximum object size 2147483647 [-Walloc-size-larger-than=] substed = xmalloc (substed_alloc_size); ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from C:/emacs/git/emacs/bignum/src/search.c:24:0: C:/emacs/git/emacs/bignum/src/lisp.h:4548:14: note: in a call to allocation function 'xmalloc' declared here extern void *xmalloc (size_t) ATTRIBUTE_MALLOC_SIZE ((1)); ^~~~~~~ 2) A selection of marker related issues: In toplevel form: ../../../lisp/cedet/semantic/wisent/javat-wy.el:265:17:Error: Wrong type argument: number-or-marker-p, 1152921504606846975 In toplevel form: ../../../lisp/cedet/semantic/wisent/js-wy.el:185:17:Error: Wrong type argument: number-or-marker-p, 1152921504606846975 In toplevel form: ../../../lisp/cedet/semantic/wisent/python-wy.el:237:17:Error: Wrong type argument: number-or-marker-p, 1152921504606846975 Eager macro-expansion failure: (wrong-type-argument number-or-marker-p 1152921504606846975) In toplevel form: ../../../lisp/cedet/semantic/wisent/python.el:38:1:Error: Wrong type argument: number-or-marker-p, 1152921504606846975 3) A problem with the ccl.el compiler for CCL programs. I think that this can be fixed by truncating the CCL code words output by the compiler in ccl.el to ensure that they doe not extend beyond the expected 28bit code word. The interpreter in ccl.c appears to range check the code words properly. In toplevel form: ../../../lisp/obsolete/pgg.el:29:1:Error: Error in CCL program In toplevel form: ../../../lisp/obsolete/pgg-gpg.el:32:1:Error: Error in CCL program In toplevel form: ../../../lisp/obsolete/pgg-pgp.el:30:1:Error: Error in CCL program In toplevel form: ../../../lisp/obsolete/pgg-pgp5.el:30:1:Error: Error in CCL program 4) Some test failures. I have omitted conditions for tests with similar complaints about number-or-markerp. Test test-calc-23889 condition: (wrong-type-argument number-or-marker-p 3568982627) FAILED 1/5 test-calc-23889 (0.084549 sec) Test test-calc-convert-units condition: (ert-test-failed ((should (calc-tests-equal (calc-tests-simple ... "-1 m" nil "cm") '...)) :form (calc-tests-equal nil (* -100 (var cm var-cm))) :value nil)) FAILED 2/5 test-calc-convert-units (0.018381 sec) Test test-calc-extract-units condition: (ert-test-failed ((should (calc-tests-equal (calc-tests-simple ... "-1 m") '...)) :form (calc-tests-equal nil (var m var-m)) :value nil)) FAILED 3/5 test-calc-extract-units (0.001062 sec) Test test-calc-remove-units condition: (ert-test-failed ((should (calc-tests-equal (calc-tests-simple ... "-1 m") -1)) :form (calc-tests-equal nil -1) :value nil)) FAILED 4/5 test-calc-remove-units (0.023494 sec) Test test-math-bignum condition: (wrong-type-argument number-or-marker-p 2305843009) FAILED 5/5 test-math-bignum (0.000160 sec) Test dired-test-bug25609 condition: (wrong-type-argument numberp #) FAILED 3/11 dired-test-bug25609 (0.028504 sec) Test viper-test-undo-2 condition: (error "Wrong type argument: numberp, #") FAILED 4/6 viper-test-undo-2 (0.053162 sec) Test eshell-test/command-running-p condition: (wrong-type-argument numberp #) FAILED 1/29 eshell-test/command-running-p (0.124705 sec) Test number-sequence-test condition: (ert-test-failed ((should (= (length ...) 2)) :form (= 1 2) :value nil)) FAILED 2/15 number-sequence-test (0.000085 sec) Test simple-transpose-subr condition: (wrong-type-argument numberp #) Test bignum-abs condition: (ert-test-failed ((should (= most-positive-fixnum (- ... 1))) :form (= 2305843009213693951 2305843009213693951) :value nil)) Test data-tests-/ condition: (ert-test-failed ((should (= most-positive-fixnum (/ x 8))) :form (= 2305843009213693951 -1) :value nil)) FAILED 22/41 data-tests-/ (0.000130 sec) Test data-tests-1+ condition: (ert-test-failed ((should (fixnump (1+ ...))) :form (fixnump -2305843009213693952) :value nil)) FAILED 23/41 data-tests-1+ (0.000151 sec) Test data-tests-1- condition: (ert-test-failed ((should (fixnump (1- ...))) :form (fixnump 2305843009213693951) :value nil)) FAILED 24/41 data-tests-1- (0.000166 sec) Test data-tests-ash-lsh condition: (ert-test-failed ((should (= (ash most-negative-fixnum 1) (* most-negative-fixnum 2))) :form (= -4611686018427387904 0) :value nil)) FAILED 30/41 data-tests-ash-lsh (0.000129 sec) 5) Assertion failures in tests. I've omitted the backtrace as it isn;t much use without decoding it, and this post is long enough already. I assume that the failing test is the next test after the previously reported passing test. passed 33/41 data-tests-local-variable-watchers (0.000995 sec) Backtrace: ... make[2]: *** [Makefile:182: src/data-tests.log] Error 3 passed 13/20 format-with-field (0.000145 sec) Backtrace: ... C:/emacs/git/emacs/bignum/src/alloc.c:3795: Emacs fatal error: assertion failed: check == 0 make[2]: *** [Makefile:182: src/editfns-tests.log] Error 3