From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#15880: Compute C declarations for DEFSYMs automatically. Date: Wed, 13 Nov 2013 21:26:46 -0800 Organization: UCLA Computer Science Department Message-ID: <52845F16.6080100@cs.ucla.edu> References: <5282C8F4.5010806@cs.ucla.edu> <52830A35.2020005@cs.ucla.edu> <5283A805.7030609@cs.ucla.edu> <5284281F.3050504@cs.ucla.edu> <52844DED.1070404@cs.ucla.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1384406847 9312 80.91.229.3 (14 Nov 2013 05:27:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 14 Nov 2013 05:27:27 +0000 (UTC) Cc: 15880@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Nov 14 06:27:30 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1VgpSb-0003sj-39 for geb-bug-gnu-emacs@m.gmane.org; Thu, 14 Nov 2013 06:27:21 +0100 Original-Received: from localhost ([::1]:53663 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VgpSa-0006rg-AI for geb-bug-gnu-emacs@m.gmane.org; Thu, 14 Nov 2013 00:27:20 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39402) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VgpSQ-0006qc-1f for bug-gnu-emacs@gnu.org; Thu, 14 Nov 2013 00:27:17 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VgpSI-0007Yx-OP for bug-gnu-emacs@gnu.org; Thu, 14 Nov 2013 00:27:09 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:37182) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VgpSI-0007Ys-KU for bug-gnu-emacs@gnu.org; Thu, 14 Nov 2013 00:27:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VgpSH-0006QY-VW for bug-gnu-emacs@gnu.org; Thu, 14 Nov 2013 00:27:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 14 Nov 2013 05:27:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15880 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 15880-submit@debbugs.gnu.org id=B15880.138440681924698 (code B ref 15880); Thu, 14 Nov 2013 05:27:01 +0000 Original-Received: (at 15880) by debbugs.gnu.org; 14 Nov 2013 05:26:59 +0000 Original-Received: from localhost ([127.0.0.1]:51201 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VgpSE-0006QG-Uv for submit@debbugs.gnu.org; Thu, 14 Nov 2013 00:26:59 -0500 Original-Received: from smtp.cs.ucla.edu ([131.179.128.62]:34415) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VgpSD-0006Q4-0v for 15880@debbugs.gnu.org; Thu, 14 Nov 2013 00:26:57 -0500 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 1838CA60003; Wed, 13 Nov 2013 21:26:51 -0800 (PST) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Original-Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZrF+JUEkxPLt; Wed, 13 Nov 2013 21:26:50 -0800 (PST) Original-Received: from [192.168.1.9] (pool-108-0-233-62.lsanca.fios.verizon.net [108.0.233.62]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 9CF76A60001; Wed, 13 Nov 2013 21:26:50 -0800 (PST) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 In-Reply-To: X-Enigmail-Version: 1.6 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:80414 Archived-At: Stefan Monnier wrote: > without link-time optimization, it probably won't be any better than > what we have Actually, I would expect the reverse. Suppose we run this: Lisp_Object x = !NILP (a) ? a : make_number (0); foo (); Lisp_Object y = !NILP (a) ? a : make_number (0); With the implementation I suggested, any decent compiler can do common subexpression elimination and optimize away the calculation of y, even if foo is an external function that does goodness knows what. That optimization can't be done with the current Emacs implementation, because the compiler can't assume that Qnil remains unmodified across foo's call (at least, not unless we have link time optimization and can look inside foo's body). If foo is a function pointer, even link time optimization won't suffice for common subexpression elimination, so the implementation I suggested should be a win even if LTO is used, even if the win isn't as large as it is in the non-LTO case.