From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Antipov Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] trunk r114593: * lisp.h (eassert): Don't use 'assume'. Date: Fri, 11 Oct 2013 14:31:07 +0400 Message-ID: <5257D36B.4090305@yandex.ru> References: <52576305.9000703@dancol.org> <52579C68.1040904@cs.ucla.edu> <83iox4pa0w.fsf@gnu.org> <5257AB8C.40309@dancol.org> <83eh7sp6v0.fsf@gnu.org> <5257B489.2050609@dancol.org> <83k3hkrxao.fsf@gnu.org> <5257C27B.9090400@dancol.org> <83hacorvww.fsf@gnu.org> <5257CB20.4030809@dancol.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1381487493 13901 80.91.229.3 (11 Oct 2013 10:31:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 11 Oct 2013 10:31:33 +0000 (UTC) Cc: Eli Zaretskii , eggert@cs.ucla.edu, emacs-devel@gnu.org To: Daniel Colascione Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Oct 11 12:31:37 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VUa0P-0001Lp-2b for ged-emacs-devel@m.gmane.org; Fri, 11 Oct 2013 12:31:37 +0200 Original-Received: from localhost ([::1]:53446 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VUa0O-0002Xe-Mr for ged-emacs-devel@m.gmane.org; Fri, 11 Oct 2013 06:31:36 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58136) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VUa0F-0002XU-SL for emacs-devel@gnu.org; Fri, 11 Oct 2013 06:31:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VUa08-0008Vy-Oj for emacs-devel@gnu.org; Fri, 11 Oct 2013 06:31:27 -0400 Original-Received: from forward10l.mail.yandex.net ([2a02:6b8:0:1819::a]:57184) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VUa00-0008TF-Mf; Fri, 11 Oct 2013 06:31:13 -0400 Original-Received: from smtp4h.mail.yandex.net (smtp4h.mail.yandex.net [84.201.186.21]) by forward10l.mail.yandex.net (Yandex) with ESMTP id 6B1AFBA0E82; Fri, 11 Oct 2013 14:31:08 +0400 (MSK) Original-Received: from smtp4h.mail.yandex.net (localhost [127.0.0.1]) by smtp4h.mail.yandex.net (Yandex) with ESMTP id C489E2C1B94; Fri, 11 Oct 2013 14:31:07 +0400 (MSK) Original-Received: from unknown (unknown [37.139.80.10]) by smtp4h.mail.yandex.net (nwsmtp/Yandex) with ESMTP id n04GIiT5pD-V758Pm46; Fri, 11 Oct 2013 14:31:07 +0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1381487467; bh=ZifFsvd7N6iPOF4E6CF6DJzIqynDmSkVYSwAYMfXq8k=; h=Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=rNR97HIEdQ1SNanbdEW4Sj/UIWUBLJQBm/XhXXKTBzHMKKzLl4NXfShPgS14k489B CQ6f2dB8tMLeVNYJPW7WRmgCIEk40wsd6QQ1O0jSh9bnnzP8Ep1vQhe7R6J/ylDAAq iSJSSJU6afWEPJHUNVJwhRbyN+z3uAp6j+uSp91g= Authentication-Results: smtp4h.mail.yandex.net; dkim=pass header.i=@yandex.ru User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0 In-Reply-To: <5257CB20.4030809@dancol.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a02:6b8:0:1819::a X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:164086 Archived-At: On 10/11/2013 01:55 PM, Daniel Colascione wrote: > You could argue that having two macros instead of one imposes a maintenance burden > and that there isn't a payoff sufficient to justify this burden, but I don't think > the maintenance cost of having another macro is very large, especially if we leave > existing assertions as they are and use the assume-and-assert macro only for cases > that are clearly free of side effects. May be I missed something, but could you please provide an example where assume (...) really yields in better code? As for the signed vs. (more efficient) unsigned arithmetic, you can't turn: int f (int x, int y, int z) { return x / y + y / z + z / x; } into: unsigned f (unsigned x, unsigned y, unsigned z) { return x / y + y / z + z / x; } using assume(...), e.g. int f (int x, int y, int z) { assume (x >= 0); assume (y >= 0); assume (z >= 0); return x / y + y / z + z / x; } is just the same as in the first case. Dmitry