From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Stephen J. Turnbull" Newsgroups: gmane.emacs.devel Subject: Re: Type-error in C code Date: Tue, 16 Nov 2010 18:05:20 +0900 Message-ID: <8739r1eizz.fsf@uwakimon.sk.tsukuba.ac.jp> References: <87vd3xog5t.fsf@keller.adm.naquadah.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1289898247 1520 80.91.229.12 (16 Nov 2010 09:04:07 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 16 Nov 2010 09:04:07 +0000 (UTC) Cc: Jan =?iso-8859-1?Q?Dj=E4rv?= , Andreas Schwab , Stefan Monnier , emacs-devel@gnu.org To: Julien Danjou Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Nov 16 10:04: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 1PIHSL-0002BJ-PZ for ged-emacs-devel@m.gmane.org; Tue, 16 Nov 2010 10:04:02 +0100 Original-Received: from localhost ([127.0.0.1]:51033 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PIHSJ-00037n-S8 for ged-emacs-devel@m.gmane.org; Tue, 16 Nov 2010 04:03:59 -0500 Original-Received: from [140.186.70.92] (port=45762 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PIHSC-00037h-PK for emacs-devel@gnu.org; Tue, 16 Nov 2010 04:03:53 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PIHSB-000759-Cr for emacs-devel@gnu.org; Tue, 16 Nov 2010 04:03:52 -0500 Original-Received: from imss12.cc.tsukuba.ac.jp ([130.158.254.161]:51528) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PIHSA-00074f-Sw for emacs-devel@gnu.org; Tue, 16 Nov 2010 04:03:51 -0500 Original-Received: from imss12.cc.tsukuba.ac.jp (imss12.cc.tsukuba.ac.jp [127.0.0.1]) by postfix.imss71 (Postfix) with ESMTP id 445EC2AF543; Tue, 16 Nov 2010 18:03:48 +0900 (JST) Original-Received: from mgmt1.sk.tsukuba.ac.jp (unknown [130.158.97.223]) by imss12.cc.tsukuba.ac.jp (Postfix) with ESMTP id 343862AF542; Tue, 16 Nov 2010 18:03:48 +0900 (JST) Original-Received: from uwakimon.sk.tsukuba.ac.jp (uwakimon.sk.tsukuba.ac.jp [130.158.99.156]) by mgmt1.sk.tsukuba.ac.jp (Postfix) with ESMTP id 2F4E23FA0525; Tue, 16 Nov 2010 18:03:48 +0900 (JST) Original-Received: by uwakimon.sk.tsukuba.ac.jp (Postfix, from userid 1000) id 5DC261A3712; Tue, 16 Nov 2010 18:05:20 +0900 (JST) In-Reply-To: <87vd3xog5t.fsf@keller.adm.naquadah.org> X-Mailer: VM undefined under 21.5 (beta29) "garbanzo" ed3b274cc037 XEmacs Lucid (x86_64-unknown-linux) 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:132697 Archived-At: Julien Danjou writes: > On Tue, Nov 16 2010, Stefan Monnier wrote: > > > We already have that with use-union-lisp-type. > > And I think it should not be an option. It should be the default. Historically, GCC has been buggy with union type in XEmacs, at least. It had problems (which regressed at least once after being fixed) with structures inside of unions. Microsoft compilers have also had trouble with it. That was ages ago == GCC 3.3 or so ... we think. So maybe it's not a relevant consideration now. It also may make things slower because it restricts the compiler from doing some code transformations that turn out (according to Martin Buchholz, anyway) entire safe in the context of Lisp object manipulations. Also, in XEmacs it conflicts with the optimizations that require no variable aliasing (there are a few places where casts are used to fit Lisp objects into XPointers and the like), which in some microbenchmarks of the XEmacs bytecode interpreter gave a small speedup. It's not just that warning; the code is actually wrong. Martin and Ben Wing claimed that GCC was being too aggressive, but the GCC developers replied reasonably enough that the code they used was technically permitted by the standard, and fixing union-type for XEmacs didn't justify the effort needed to add a special case. Finally, note that a default *is* an option. Do you want to force union type for all builds, or do you want to make it the default and leave the option to the user to use the (possibly faster) bit-flicking implementation?