From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Pip Cet Newsgroups: gmane.emacs.bugs Subject: bug#36370: 27.0.50; XFIXNAT called on negative numbers Date: Sat, 29 Jun 2019 05:44:22 +0000 Message-ID: References: <11002295.LrvMqknVDZ@omega> <2067160.1HRgjLhtDS@omega> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="154629"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 36370@debbugs.gnu.org, Paul Eggert , bug-gnulib@gnu.org To: Bruno Haible Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jun 29 07:46:12 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 1hh6Bf-000e0j-LW for geb-bug-gnu-emacs@m.gmane.org; Sat, 29 Jun 2019 07:46:11 +0200 Original-Received: from localhost ([::1]:37934 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hh6Be-0003xE-Et for geb-bug-gnu-emacs@m.gmane.org; Sat, 29 Jun 2019 01:46:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55771) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hh6BY-0003x3-QL for bug-gnu-emacs@gnu.org; Sat, 29 Jun 2019 01:46:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hh6BW-0006sn-Li for bug-gnu-emacs@gnu.org; Sat, 29 Jun 2019 01:46:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57981) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hh6BV-0006sL-Ui for bug-gnu-emacs@gnu.org; Sat, 29 Jun 2019 01:46:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hh6BV-0000kU-S7 for bug-gnu-emacs@gnu.org; Sat, 29 Jun 2019 01:46:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Pip Cet Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 29 Jun 2019 05:46:01 +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.15617871062807 (code B ref 36370); Sat, 29 Jun 2019 05:46:01 +0000 Original-Received: (at 36370) by debbugs.gnu.org; 29 Jun 2019 05:45:06 +0000 Original-Received: from localhost ([127.0.0.1]:43292 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hh6Ab-0000jC-QG for submit@debbugs.gnu.org; Sat, 29 Jun 2019 01:45:06 -0400 Original-Received: from mail-oi1-f194.google.com ([209.85.167.194]:34745) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hh6Aa-0000iQ-Dl for 36370@debbugs.gnu.org; Sat, 29 Jun 2019 01:45:04 -0400 Original-Received: by mail-oi1-f194.google.com with SMTP id l12so5905760oil.1 for <36370@debbugs.gnu.org>; Fri, 28 Jun 2019 22:45:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ZQpCeJ5oSnrBRe/lcvYLFsZuVGlB2HREI6j35y2nIgQ=; b=nEAWKNVdrzCho06gFQS89/Zy1xxjx9C9JQ+rYrzxurtuMUIIAMRJEvQkvIkwK77qXN fAUrp+0WEcwUdqACAlZ+QL3C//VjyGKlGgJhIc0eKGQ6DUQFfVQUyHhu8dRx4XmthZGq W0pYRe16k8lWw8/l74ZoIaofDMjWpKs8BsIoeD3mxLaLNYD0gWYcYIHsYRQzD/sXZHGC WeyRw2LshALDrg9vBW/xio1zzwcjGl12cvz3YrEzPyjOpPhoq9djLsmo7wlMzj5rxYFp GoSDrlClWivEoE/rSHl5Fy4fBVTGpbYWaWboD/L+4eJUlC8239PlwELkUb5+7I3cEW3X vEdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ZQpCeJ5oSnrBRe/lcvYLFsZuVGlB2HREI6j35y2nIgQ=; b=YPBV4z9RcwFHxSECJQC2ss4MsKe2YEOmWA6lH3SN2YbVgJcHNx4sHQ34DoxqCVm68n VDY24whPADDSNxgzmBgf7fcuVnaOVo1Ro3D8uzRZ+uGSQVc/hM58THwZQUyKOYViAObU nCkqurdQk/eterTvmS7I6UDvCKac1gedY5sv7VUc9CkQLrKVvEIf/XK1AHcDrX7sTZ15 WPIudxlKAgnGGUTkPhPl9bm2+ZKe2P6+p6lPFov84jcquP9GnPNdrSeUy7ntTjEBM0sO K9fp6aP/Sl8OqizXy6WqsdL9LZiGahoXM7xm+edwadoVdhBYIoJ7T9gB48zWkQEXOm3R 7HOg== X-Gm-Message-State: APjAAAXvhgIeRLzDd4JP6tC4fW7/R4znajsn4jJva+R904HPFzYeghDh 4gMILzeEuJIQetyjQXeDZGmyrE3tW7j3/WngVnI= X-Google-Smtp-Source: APXvYqwr4B01jYHQa5TvncWJM5QnnaWy1G+fZcmOboqRk7JIWi2jx1qt9z+ArRNTvUssVPUmQTXQCc9mO+LW+AXTesQ= X-Received: by 2002:a05:6808:313:: with SMTP id i19mr800977oie.30.1561787098322; Fri, 28 Jun 2019 22:44:58 -0700 (PDT) In-Reply-To: <2067160.1HRgjLhtDS@omega> 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:161791 Archived-At: On Fri, Jun 28, 2019 at 11:30 PM Bruno Haible wrote: > Pip Cet wrote: > > have started believing the "an inline function is as fast as a macro" > > mantra*, assuming you include inline functions with "function calls". > > Ah, that's where the entire topic with the function calls inside assume() > comes from! I agree it's an important case (more important than the > functions defined in other compilation units). As I said earlier: ---- This makes it safe to use function expressions in eassume, whether the function is inlined or not. (That GCC doesn't actually do very much with this information is a separate issue). ---- So we're talking about this separate issue now? I ask not for rhetorical points, but because I genuinely think it's interesting if the objection is based on GCC limitations rather than fundamentally unfixable reasons. > So, the main effect of the proposed new 'assume' is that it de-optimizes > the case where the CONDITION is defined using inline functions! (I don't think it's the "main" effect). That certainly is something that appears to be happening in some situations. It's a GCC limitation, and let's be clear: as long as this limitation isn't lifted, an inline function is not as fast as a macro. However, passing an inline function to assume() is problematic anyway, unless it's marked as __attribute__((always_inline)), and marking it as __attribute__((always_inline)) is problematic because it might directly contradict what the programmer was trying to achieve by passing -fno-inline. > Based on these results, I formally object against the proposed patch. I won't argue against that as long as I haven't found a way around the GCC issue, but I would like to state that the current assume does behave very badly when combined with -fno-inline-small-functions -fno-inline. > > > (2) that the generated code will never include these function calls, > > > because the generated code with the 'assume' invocation should be > > > optimized at least as well as the generated code without the > > > 'assume' invocation. > > > > I think it should be the rarest of exceptions for an assume() to > > result in slower code, yes. I believe that includes the case where > > functions marked inline aren't inlined, because of compiler options, > > for example. > > Then, I think we should change the documentation of 'assume' to say > that when it invokes functions, these functions should be marked > '__attribute__ ((__always_inline__))', otherwise performance will > be worse than without the 'assume', not better. I disagree. It's tedious, and people might just change their INLINE macros (or whatever) to specify __attribute__((always_inline)), making -fno-inline worthless... > > I think there's a significant probability that the GCC people would > > agree to add such a built-in, but insist on its having "may or may not > > evaluate its argument" semantics. > > We can tell them that it would be important for us that is does not > evaluate its argument. Like sizeof (EXPRESSION) does not evaluate EXPRESSION. We can tell them that, but my suspicion is it'll be much, much harder to implement that way.