GNU bug report logs - #15880
Compute C declarations for DEFSYMs automatically.

Previous Next

Package: emacs;

Reported by: Paul Eggert <eggert <at> cs.ucla.edu>

Date: Wed, 13 Nov 2013 00:35:02 UTC

Severity: wishlist

Tags: patch

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


Message #53 received at 15880 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 15880 <at> debbugs.gnu.org
Subject: Re: bug#15880: Compute C declarations for DEFSYMs automatically.
Date: Wed, 13 Nov 2013 21:26:46 -0800
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.




This bug report was last modified 10 years and 131 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.