unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Pip Cet <pipcet@gmail.com>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: 36370@debbugs.gnu.org, Gnulib bugs <bug-gnulib@gnu.org>
Subject: bug#36370: 27.0.50; XFIXNAT called on negative numbers
Date: Thu, 27 Jun 2019 21:37:25 +0000	[thread overview]
Message-ID: <CAOqdjBe_0qMDaryk2M_hKJXxT-Ef=KekxnFbhF2fKhTdcWzuTw@mail.gmail.com> (raw)
In-Reply-To: <5284eb58-3560-da42-d1d1-3bdb930eae49@cs.ucla.edu>

On Thu, Jun 27, 2019 at 9:13 PM Paul Eggert <eggert@cs.ucla.edu> wrote:
> On 6/27/19 12:56 PM, Pip Cet wrote:
> > The eassume tells GCC i is nonnegative, since (!(i >= 0) == !(i >= 0))
> > is indeed a constant.
>
> Ah! Thanks, I didn't catch that subtle point. Would the attached patch
> to verify.h address that problem? This patch is for Gnulib, but would
> propagate into Emacs.

Eventually, I think that would be a good idea. But right now, I would
like to figure out why GCC isn't generating code that's as good as it
should be.

> I tried this out with Emacs master and although it did change the
> machine code subtly I didn't have the patience to see whether the
> changes were likely to improve performance. The changes did grow the
> Emacs text segment from 2556193 to 2557657 bytes (a 0.06% growth), which
> is not a good sign. This was on Fedora 30 x86-64 with a default Emacs build.

So far, what I've found is that

  eassume (0 <= i && i < bool_vector_size (a));

doesn't work with my patch. Tweaking that to

  eassume (0 <= i);
  eassume (i < bool_vector_size (a));

appears to help a little, but it's a good idea to avoid generating a
call to a function that might be out-lined by the compiler, in any
case.

One thing I've neglected to look at in detail, because Emacs isn't
affected by it, is how this works with pure functions.

> I'll CC: this to bug-gnulib since it's a Gnulib issue. I have not
> installed this patch into Gnulib on savannah.

I'd be extremely interested in any comments people might have!





  parent reply	other threads:[~2019-06-27 21:37 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-25  5:36 bug#36370: 27.0.50; XFIXNAT called on negative numbers Pip Cet
2019-06-27  1:10 ` Paul Eggert
2019-06-27  6:16   ` Pip Cet
2019-06-27  8:28     ` Paul Eggert
2019-06-27 13:17       ` Pip Cet
2019-06-27 13:37         ` Eli Zaretskii
2019-06-27 19:38         ` Paul Eggert
2019-06-27 19:56           ` Pip Cet
2019-06-27 21:13             ` Paul Eggert
     [not found]             ` <5284eb58-3560-da42-d1d1-3bdb930eae49@cs.ucla.edu>
2019-06-27 21:37               ` Pip Cet [this message]
2019-06-27 23:45               ` Bruno Haible
     [not found]               ` <2715311.ceefYqj39C@omega>
2019-06-28  0:04                 ` Paul Eggert
2019-06-28 11:06                 ` Pip Cet
2019-06-28 12:14                   ` Bruno Haible
     [not found]                   ` <8979488.cRkkfcT1mV@omega>
2019-06-28 12:29                     ` Bruno Haible
2019-06-28 13:51                     ` Pip Cet
     [not found]                     ` <CAOqdjBfS99UpLZ-qLe4=FMXMsr+T3LUvJEsf_gfmF6wwLbqgOw@mail.gmail.com>
2019-06-28 17:46                       ` Paul Eggert
2019-06-28 19:11                       ` Bruno Haible
     [not found]                       ` <a293f2fe-99b3-3776-f27b-35e3a93d1d34@cs.ucla.edu>
2019-06-28 19:15                         ` Pip Cet
2019-06-28 19:56                           ` Bruno Haible
2019-06-28 21:08                             ` Pip Cet
2019-06-29  5:41                           ` Paul Eggert
     [not found]                           ` <87168b28-192b-6666-e9b6-9cdc2ed3917a@cs.ucla.edu>
2019-06-29  6:48                             ` Pip Cet
     [not found]                             ` <CAOqdjBfcNbXFw3Fb0wgRR10PNbkJQ+88ObE9KEghLSb-ptdrbA@mail.gmail.com>
2019-06-29 17:31                               ` Paul Eggert
     [not found]                               ` <791ae316-3a6f-605a-0da5-874fe3d224c5@cs.ucla.edu>
2019-06-30  9:21                                 ` Pip Cet
     [not found]                       ` <11002295.LrvMqknVDZ@omega>
2019-06-28 21:07                         ` Pip Cet
2019-06-28 23:30                           ` Bruno Haible
     [not found]                           ` <2067160.1HRgjLhtDS@omega>
2019-06-29  5:40                             ` Paul Eggert
2019-06-29  5:44                             ` Pip Cet
     [not found]                             ` <CAOqdjBcNA4mDiwsd_jbeePGMdUwPvkFCNdgtZvmiQnYmJNR3pA@mail.gmail.com>
2019-06-29 10:31                               ` Bruno Haible
     [not found]                               ` <2515002.Q0mBYvUW8C@omega>
2019-06-29 17:11                                 ` Paul Eggert
     [not found]                                 ` <99bacb9f-1192-1315-85d7-5ab4924dfef8@cs.ucla.edu>
2019-06-29 17:48                                   ` Bruno Haible
2019-06-30 15:30                                 ` Pip Cet
     [not found]                                 ` <CAOqdjBeiMno7nGKwk7SSZQob+CTyG39KRTM9EEebq7NQavLR-Q@mail.gmail.com>
2019-06-30 15:45                                   ` Bruno Haible
2019-07-02 23:39                                     ` Paul Eggert
2019-07-01  1:46                                   ` Richard Stallman

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to='CAOqdjBe_0qMDaryk2M_hKJXxT-Ef=KekxnFbhF2fKhTdcWzuTw@mail.gmail.com' \
    --to=pipcet@gmail.com \
    --cc=36370@debbugs.gnu.org \
    --cc=bug-gnulib@gnu.org \
    --cc=eggert@cs.ucla.edu \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).