From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS22989 209.51.188.0/24 X-Spam-Status: No, score=-4.1 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id B04D11F461 for ; Sat, 29 Jun 2019 17:12:08 +0000 (UTC) Received: from localhost ([::1]:41532 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hhGtT-0006Xs-1v for normalperson@yhbt.net; Sat, 29 Jun 2019 13:12:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58649) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hhGtP-0006Xm-GL for bug-gnulib@gnu.org; Sat, 29 Jun 2019 13:12:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hhGtM-0005D3-Jx for bug-gnulib@gnu.org; Sat, 29 Jun 2019 13:12:02 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:43068) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hhGtJ-0004zy-5v for bug-gnulib@gnu.org; Sat, 29 Jun 2019 13:11:57 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 1C3D2161D51; Sat, 29 Jun 2019 10:11:48 -0700 (PDT) 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 lpYml8JESCC8; Sat, 29 Jun 2019 10:11:43 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 9C00B161D92; Sat, 29 Jun 2019 10:11:43 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu 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 nWbzsneUassO; Sat, 29 Jun 2019 10:11:43 -0700 (PDT) Received: from [192.168.1.9] (cpe-23-242-74-103.socal.res.rr.com [23.242.74.103]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 59286161D51; Sat, 29 Jun 2019 10:11:43 -0700 (PDT) Subject: Re: bug#36370: 27.0.50; XFIXNAT called on negative numbers To: Bruno Haible , Pip Cet References: <2067160.1HRgjLhtDS@omega> <2515002.Q0mBYvUW8C@omega> From: Paul Eggert Organization: UCLA Computer Science Department Message-ID: <99bacb9f-1192-1315-85d7-5ab4924dfef8@cs.ucla.edu> Date: Sat, 29 Jun 2019 10:11:40 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.1 MIME-Version: 1.0 In-Reply-To: <2515002.Q0mBYvUW8C@omega> Content-Type: multipart/mixed; boundary="------------5B2A11EADDDA2B68ABEB62B9" Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 131.179.128.68 X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 36370@debbugs.gnu.org, bug-gnulib@gnu.org Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" This is a multi-part message in MIME format. --------------5B2A11EADDDA2B68ABEB62B9 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Bruno Haible wrote: > + 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__))'. */ A reader of that might incorrectly conclude that using such functions will always improve performance, compared to using functions not declared that way. And I'm leery of putting such GCC-specific info into the documentation of a generic macro. Also, given Pip Cet's misunderstanding it'd be helpful to add a word or two about the intent of 'assume (R)'. How about the attached patch? > - evaluated. Behavior is undefined if R is false. */ > + evaluated. The behavior is undefined if R is false. This is a nit, but to my ears the shorter version is better, and has a more-accurate connotation as "the behavior" connotes "the behavior of 'assume (R)'", whereas behavior is also undefined for code before or after a call to an incorrect 'assume (R)'. --------------5B2A11EADDDA2B68ABEB62B9 Content-Type: text/x-patch; name="verify.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="verify.diff" diff --git a/lib/verify.h b/lib/verify.h index f8e4eff02..168a7afdb 100644 --- a/lib/verify.h +++ b/lib/verify.h @@ -259,9 +259,11 @@ template # define __has_builtin(x) 0 #endif -/* 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. */ +/* Assume that R always holds. Behavior is undefined if R is false. + R should lack side effects, as it may be evaluated only partially. + Although 'assume (R)' is typically intended to help performance, + performance may degrade if R uses hard-to-optimize features + such as calls to non-inlined functions. */ #if (__has_builtin (__builtin_unreachable) \ || 4 < __GNUC__ + (5 <= __GNUC_MINOR__)) --------------5B2A11EADDDA2B68ABEB62B9--