From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#36597: 27.0.50; rehash hash tables eagerly in pdumper Date: Tue, 11 Aug 2020 16:43:16 -0700 Organization: UCLA Computer Science Department Message-ID: <80399aee-a2ef-5d24-a19e-5ea615190cf9@cs.ucla.edu> References: <74235afc-7043-1da7-7c71-07f0ca23b9fd@cs.ucla.edu> <83r26mv53z.fsf@gnu.org> <87ft8vbow1.fsf@gnus.org> <87v9hq4ppp.fsf@gnus.org> <83k0y544lf.fsf@gnu.org> <8bf60d70-6b0d-0e07-fef9-9baad9d7749c@cs.ucla.edu> <837du5p17p.fsf@gnu.org> <63d00359-f7cc-5564-ecf0-d374dea979ff@cs.ucla.edu> <83zh71ni7r.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------E4C7ADFDC9C38D3F93513070" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2796"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 Cc: larsi@gnus.org, 36597@debbugs.gnu.org, pipcet@gmail.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Aug 12 01:44:12 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k5dwB-0000cG-Ub for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 12 Aug 2020 01:44:12 +0200 Original-Received: from localhost ([::1]:47374 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k5dwA-0005H5-HM for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 11 Aug 2020 19:44:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48480) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k5dw2-0005Gz-M3 for bug-gnu-emacs@gnu.org; Tue, 11 Aug 2020 19:44:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58702) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k5dw2-0001LG-DL for bug-gnu-emacs@gnu.org; Tue, 11 Aug 2020 19:44:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1k5dw2-0005Jd-8m for bug-gnu-emacs@gnu.org; Tue, 11 Aug 2020 19:44:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 11 Aug 2020 23:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36597 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 36597-submit@debbugs.gnu.org id=B36597.159718940720385 (code B ref 36597); Tue, 11 Aug 2020 23:44:02 +0000 Original-Received: (at 36597) by debbugs.gnu.org; 11 Aug 2020 23:43:27 +0000 Original-Received: from localhost ([127.0.0.1]:42015 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k5dvS-0005Ij-RG for submit@debbugs.gnu.org; Tue, 11 Aug 2020 19:43:27 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:39760) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k5dvQ-0005IU-HO for 36597@debbugs.gnu.org; Tue, 11 Aug 2020 19:43:25 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 00CB11600ED; Tue, 11 Aug 2020 16:43:19 -0700 (PDT) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id gyiGSdtfP6LZ; Tue, 11 Aug 2020 16:43:18 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 2167C1600FC; Tue, 11 Aug 2020 16:43:18 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id VGiQm_ExxJjf; Tue, 11 Aug 2020 16:43:18 -0700 (PDT) Original-Received: from [192.168.1.9] (cpe-75-82-69-226.socal.res.rr.com [75.82.69.226]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id E47661600ED; Tue, 11 Aug 2020 16:43:17 -0700 (PDT) Autocrypt: addr=eggert@cs.ucla.edu; prefer-encrypt=mutual; keydata= LS0tLS1CRUdJTiBQR1AgUFVCTElDIEtFWSBCTE9DSy0tLS0tCgptUUlOQkV5QWNtUUJFQURB QXlIMnhvVHU3cHBHNUQzYThGTVpFb243NGRDdmM0K3ExWEEySjJ0QnkycHdhVHFmCmhweHhk R0E5Smo1MFVKM1BENGJTVUVnTjh0TFowc2FuNDdsNVhUQUZMaTI0NTZjaVNsNW04c0thSGxH ZHQ5WG0KQUF0bVhxZVpWSVlYL1VGUzk2ZkR6ZjR4aEVtbS95N0xiWUVQUWRVZHh1NDd4QTVL aFRZcDVibHRGM1dZRHoxWQpnZDdneDA3QXV3cDdpdzdlTnZub0RUQWxLQWw4S1lEWnpiRE5D UUdFYnBZM2VmWkl2UGRlSStGV1FONFcra2doCnkrUDZhdTZQcklJaFlyYWV1YTdYRGRiMkxT MWVuM1NzbUUzUWpxZlJxSS9BMnVlOEpNd3N2WGUvV0szOEV6czYKeDc0aVRhcUkzQUZINmls QWhEcXBNbmQvbXNTRVNORnQ3NkRpTzFaS1FNcjlhbVZQa25qZlBtSklTcWRoZ0IxRApsRWR3 MzRzUk9mNlY4bVp3MHhmcVQ2UEtFNDZMY0ZlZnpzMGtiZzRHT1JmOHZqRzJTZjF0azVlVThN Qml5Ti9iClowM2JLTmpOWU1wT0REUVF3dVA4NGtZTGtYMndCeHhNQWhCeHdiRFZadWR6eERa SjFDMlZYdWpDT0pWeHEya2wKakJNOUVUWXVVR3FkNzVBVzJMWHJMdzYrTXVJc0hGQVlBZ1Jy NytLY3dEZ0JBZndoU In-Reply-To: <83zh71ni7r.fsf@gnu.org> Content-Language: en-US X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:184703 Archived-At: This is a multi-part message in MIME format. --------------E4C7ADFDC9C38D3F93513070 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 8/11/20 11:35 AM, Eli Zaretskii wrote: > It doesn't, because we avoid the Gnulib inttypes module on MinGW. In that case perhaps I should revert the change that added the Gnulib inttypes module, as MS-Windows is the only currently-active platform with PRIdPTR etc. problems that I've heard of. > I don't understand why it's needed; there's nothing wrong with MinGW's > inttypes.h header. I don't know what the problems with MS-Windows are or were. Perhaps they're fixed on all development environments we know about. That would suggest reverting the inttypes change too. Does the attached simplification pacify GCC on MinGW? If so, that could be combined with reverting the inttypes change. Does the following standalone program compile OK with 'gcc -Wall' on MinGW? If so, why does the same thing not work when compiling Emacs? The error message you quoted in Bug#36597#67 suggests that PRIdPTR is "d" whereas intptr_t is 'long' which means the following program should run afoul of MinGW. #include #include char buf[1000]; intptr_t ip; int main (void) { return sprintf (buf, "%"PRIdPTR, ip); } --------------E4C7ADFDC9C38D3F93513070 Content-Type: text/x-patch; charset=UTF-8; name="pdumper.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="pdumper.diff" diff --git a/src/pdumper.c b/src/pdumper.c index 7708bc892f..0bc48aedbe 100644 --- a/src/pdumper.c +++ b/src/pdumper.c @@ -143,8 +143,6 @@ #define DUMP_OFF_MIN INT_LEAST32_MIN #define DUMP_OFF_MAX INT_LEAST32_MAX #define PRIdDUMP_OFF PRIdLEAST32 -enum { EMACS_INT_XDIGITS = (EMACS_INT_WIDTH + 3) / 4 }; - static void ATTRIBUTE_FORMAT_PRINTF (1, 2) dump_trace (const char *fmt, ...) { @@ -1008,9 +1006,7 @@ dump_queue_enqueue (struct dump_queue *dump_queue, if (NILP (weights)) { /* Object is new. */ - EMACS_UINT uobj = XLI (object); - dump_trace ("new object %0*"pI"x weight=%d\n", EMACS_INT_XDIGITS, uobj, - weight.value); + dump_trace ("new object %p weight=%d\n", XLP (object), weight.value); if (weight.value == WEIGHT_NONE.value) { @@ -1306,10 +1302,9 @@ dump_queue_dequeue (struct dump_queue *dump_queue, dump_off basis) else emacs_abort (); - EMACS_UINT uresult = XLI (result); - dump_trace (" result score=%f src=%s object=%0*"pI"x\n", + dump_trace (" result score=%f src=%s object=%p\n", best < 0 ? -1.0 : (double) candidates[best].score, - src, EMACS_INT_XDIGITS, uresult); + src, XLP (result)); { Lisp_Object weights = Fgethash (result, dump_queue->link_weights, Qnil); --------------E4C7ADFDC9C38D3F93513070--