From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Bruno Haible Newsgroups: gmane.emacs.bugs Subject: bug#36370: 27.0.50; XFIXNAT called on negative numbers Date: Sat, 29 Jun 2019 12:31:27 +0200 Message-ID: <2515002.Q0mBYvUW8C__23902.1847768285$1561804335$gmane$org@omega> References: <2067160.1HRgjLhtDS@omega> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="189935"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: KMail/5.1.3 (Linux/4.4.0-151-generic; KDE/5.18.0; x86_64; ; ) Cc: 36370@debbugs.gnu.org, Paul Eggert , bug-gnulib@gnu.org To: Pip Cet Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jun 29 12:32:10 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hhAeQ-000nL3-Df for geb-bug-gnu-emacs@m.gmane.org; Sat, 29 Jun 2019 12:32:10 +0200 Original-Received: from localhost ([::1]:38738 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hhAeP-0004N2-Cq for geb-bug-gnu-emacs@m.gmane.org; Sat, 29 Jun 2019 06:32:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46995) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hhAeJ-0004Mf-QU for bug-gnu-emacs@gnu.org; Sat, 29 Jun 2019 06:32:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hhAeI-0005CP-Oy for bug-gnu-emacs@gnu.org; Sat, 29 Jun 2019 06:32:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58199) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hhAeI-0005By-Kh for bug-gnu-emacs@gnu.org; Sat, 29 Jun 2019 06:32:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hhAeI-0001MT-Fo for bug-gnu-emacs@gnu.org; Sat, 29 Jun 2019 06:32:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Bruno Haible Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 29 Jun 2019 10:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36370 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 36370-submit@debbugs.gnu.org id=B36370.15618042955196 (code B ref 36370); Sat, 29 Jun 2019 10:32:02 +0000 Original-Received: (at 36370) by debbugs.gnu.org; 29 Jun 2019 10:31:35 +0000 Original-Received: from localhost ([127.0.0.1]:43510 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hhAdq-0001Lk-WC for submit@debbugs.gnu.org; Sat, 29 Jun 2019 06:31:35 -0400 Original-Received: from mo4-p00-ob.smtp.rzone.de ([85.215.255.22]:24207) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hhAdo-0001Lb-G3 for 36370@debbugs.gnu.org; Sat, 29 Jun 2019 06:31:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1561804290; s=strato-dkim-0002; d=clisp.org; h=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=ZrpzzZ86xSTJdW1fP5mHnYFwebioHLmIMtiUZo2aIWI=; b=MYFDWMDor7u4xXNEQCn61+ZXzd2Kji8qWt18Ka/XnO3F78Qjjo75Tqddsux8gje+zr sNczm+eblymURgwgQWfph8H4dU3fJwdByElFwFgZ82wZoj+FF1UhwxVkTD9LC+WhX4vH FTpSAtjIwPxRT1+JDaD4Qck0xJDjp28oqviJnygV5WNF+HpcRl+0BfQvtBrj8Dv2nRGE 8myGywvhYBGKPBLqhJwQ9iaXhG5ddXWdcVu+MtmI8oJD4nyWkzY2NsoUnyKV6Zt3vnhx JPiweuOhWEucpsaekaSo4O0iZgsvqBOE9Y8o44nYQIWckbsMSYZM3OVnq5bBNHVMFwI4 H20w== X-RZG-AUTH: ":Ln4Re0+Ic/6oZXR1YgKryK8brlshOcZlIWs+iCP5vnk6shH+AHjwLuWOGaf0zJZW" X-RZG-CLASS-ID: mo00 Original-Received: from bruno.haible.de by smtp.strato.de (RZmta 44.24 DYNA|AUTH) with ESMTPSA id v018bcv5TAVSlqL (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate); Sat, 29 Jun 2019 12:31:28 +0200 (CEST) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:161813 Archived-At: Pip Cet wrote: > I would like to state that the current assume does > behave very badly when combined with -fno-inline-small-functions > -fno-inline. Since we can't address this limitation through an acceptable change to the 'assume' macro, we need to address it through documentation. > marking it > as __attribute__((always_inline)) is problematic because it might > directly contradict what the programmer was trying to achieve by > passing -fno-inline. __attribute__((always_inline)) exists precisely to make a distinction between functions where inlining is usually desirable vs. functions where inlining is essential. We don't need to warn against the uses of __attribute__((always_inline)) -- confusing behaviour in the debugger etc. -- becauses these drawbacks are already well-known. Paul Eggert wrote: > I suggest something simpler and a little more general. The Emacs documentation > for 'eassume' says this: > > This can improve performance in some cases, > though it can degrade performance in others. It's often suboptimal > for COND to call external functions or access volatile storage. > > and we could migrate that into the documentation for 'assume'. As a user of the 'assume' macro, I want a definitive statement about what I need to provide so that the macro works in the sense of improved performance. A statement about "often" is too vague. How about this proposed patch? diff --git a/lib/verify.h b/lib/verify.h index f8e4eff..ed1ba19 100644 --- a/lib/verify.h +++ b/lib/verify.h @@ -261,7 +261,10 @@ template /* Assume that R always holds. This lets the compiler optimize accordingly. R should not have side-effects; it may or may not be - evaluated. Behavior is undefined if R is false. */ + evaluated. The behavior is undefined if R is false. + If you want the use of this macro to improve, not deteriorate, + performance, R should not contain function calls except to functions + that are declared 'inline __attribute__((__always_inline__))'. */ #if (__has_builtin (__builtin_unreachable) \ || 4 < __GNUC__ + (5 <= __GNUC_MINOR__))