[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Type-error in C code

From: Stephen J. Turnbull
Subject: Re: Type-error in C code
Date: Tue, 16 Nov 2010 18:05:20 +0900

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]