From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ken Raeburn Newsgroups: gmane.emacs.devel Subject: Re: stop using P_, __P in header files Date: Mon, 5 Jul 2010 14:59:45 -0400 Message-ID: References: <4C2DB1E0.7010305@swipnet.se> <83aaqa9ml7.fsf@gnu.org> <9A690AC5-8C59-4691-88AC-EDDABCF2F704@raeburn.org> <83ocem8w6i.fsf@gnu.org> <83k4p996o0.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1278356408 13767 80.91.229.12 (5 Jul 2010 19:00:08 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 5 Jul 2010 19:00:08 +0000 (UTC) Cc: Juanma Barranquero , emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jul 05 21:00:07 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OVqtg-0004Kp-9V for ged-emacs-devel@m.gmane.org; Mon, 05 Jul 2010 21:00:04 +0200 Original-Received: from localhost ([127.0.0.1]:42702 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OVqtf-0005Pk-49 for ged-emacs-devel@m.gmane.org; Mon, 05 Jul 2010 15:00:03 -0400 Original-Received: from [140.186.70.92] (port=54828 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OVqtZ-0005OB-I7 for emacs-devel@gnu.org; Mon, 05 Jul 2010 14:59:58 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OVqtY-0003u6-BD for emacs-devel@gnu.org; Mon, 05 Jul 2010 14:59:57 -0400 Original-Received: from splat.raeburn.org ([69.25.196.39]:60087 helo=raeburn.org) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OVqtQ-0003tB-Ka; Mon, 05 Jul 2010 14:59:56 -0400 Original-Received: from squish.raeburn.org (squish.raeburn.org [10.0.0.172]) by raeburn.org (8.14.3/8.14.1) with ESMTP id o65IxjMY011124; Mon, 5 Jul 2010 14:59:45 -0400 (EDT) In-Reply-To: <83k4p996o0.fsf@gnu.org> X-Mailer: Apple Mail (2.1081) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:126795 Archived-At: On Jul 5, 2010, at 13:31, Eli Zaretskii wrote: > I'm not an expert, so I don't know. Maybe someone else could chime > in. One issue that I'd be interested in is to know whether GCC uses > this hint at some low optimization level, =46rom skimming some GCC code, it looks to me like either having the = optimizer on, or using "register", may cause registers to be used. = (Specifically, if the optimizer is off and "register" is not used, then = automatic variables appear to get stack slots unconditionally; = otherwise, types and other restrictions permitting, they get = "pseudo-registers" which may be assigned either registers or stack = slots.) So, for -O0, the register declarations might make a difference = (I don't know how good the "stupid" allocator is for non-optimizing = compiles), though my attitude is generally that for -O0, performance = considerations don't matter much... For -O1, I don't think the register = declarations matter. > FWIW, the ones I put in some code I wrote long ago were not naive at > all. And I don't think those we have in Emacs are naive, either. But > if these hints are not used, it doesn't really matter. If we assume we don't have to tune the code for builds without decent = optimization (including gcc -O0), I think at least some of them are kind = of useless -- like any place where *all* the non-addressable variables = are declared "register". If that's a meaningful hint these days, the = compiler's not doing a very good job. Back in the '80s, when PCC was = one of the more popular compilers around, you had to say "register" or = everything would go in stack slots, even with the optimizer on. And the = first N register variables got assigned to a specific set of machine = registers -- I recall working with VAX BSD kernel code that made use of = known registers this way. So for small functions, it made sense to make = everything "register", when that was the common technology. After a quick "grep register *.[chm]", the first one I pulled up was = data.c:Fsetq_default, where all the automatic variables but "gcpro1" are = "register", though the argument wasn't. Next was data.c:Fneq, where = both arguments are. In data.c:Fash, all arguments and automatics are. = These really look like cases of PCC workarounds. In = dbusbind.c:Fdbus_method_return_internal, only "args" is; maybe that's = possibly helpful, to some compiler somewhere; but shouldn't a decent = optimizer figure it out from the large number of uses of the variable? Ken=