From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Type-error in C code Date: Tue, 16 Nov 2010 12:05:00 -0500 Message-ID: References: <87vd3xog5t.fsf@keller.adm.naquadah.org> <87wrodjn27.fsf@keller.adm.naquadah.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1289927586 15542 80.91.229.12 (16 Nov 2010 17:13:06 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 16 Nov 2010 17:13:06 +0000 (UTC) Cc: emacs-devel@gnu.org To: Julien Danjou Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Nov 16 18:13:02 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 1PIP5V-0007Ph-OO for ged-emacs-devel@m.gmane.org; Tue, 16 Nov 2010 18:13:01 +0100 Original-Received: from localhost ([127.0.0.1]:55040 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PIP5T-0001i8-9B for ged-emacs-devel@m.gmane.org; Tue, 16 Nov 2010 12:12:55 -0500 Original-Received: from [140.186.70.92] (port=49580 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PIOyF-0006oU-IH for emacs-devel@gnu.org; Tue, 16 Nov 2010 12:05:30 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PIOy2-00038l-L2 for emacs-devel@gnu.org; Tue, 16 Nov 2010 12:05:15 -0500 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:55581) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PIOy2-00037p-Gm for emacs-devel@gnu.org; Tue, 16 Nov 2010 12:05:14 -0500 Original-Received: from faina.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id oAGH50qR032219; Tue, 16 Nov 2010 12:05:01 -0500 Original-Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id 44DA413002B; Tue, 16 Nov 2010 12:05:00 -0500 (EST) In-Reply-To: <87wrodjn27.fsf@keller.adm.naquadah.org> (Julien Danjou's message of "Tue, 16 Nov 2010 16:38:40 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3681=0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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:132734 Archived-At: >> Same problem as the structs type: it's not optimized as well as the >> int/long... types. > May I ask any references about that? > Not that I don't trust you, but I'd like to know why. IIRC calling conventions usually dictate that non-scalar types get passed via copies on the stack rather than in registers. Also of course, in general structs can't be handled in the same way as int/long/... by the compiler, so in order to handle single-slot structs efficiently, the compiler needs to special case these. I'd expect a mature C compiler to go through the trouble to try and special-case them, but that's no guarantee that it's going to be as efficient as just scalar types. Stefan