GNU bug report logs -
#36370
27.0.50; XFIXNAT called on negative numbers
Previous Next
Reported by: Pip Cet <pipcet <at> gmail.com>
Date: Tue, 25 Jun 2019 05:37:02 UTC
Severity: normal
Tags: patch
Found in version 27.0.50
Done: Paul Eggert <eggert <at> cs.ucla.edu>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
On Thu, Jun 27, 2019 at 9:13 PM Paul Eggert <eggert <at> 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!
This bug report was last modified 6 years and 20 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.