summaryrefslogtreecommitdiff
path: root/src/lisp.h
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2020-04-04 16:56:57 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2020-04-04 16:57:43 -0700
commit15853707c8c36aff1d3cc19205971b88e04d007b (patch)
tree500707c66fb48e90d4a10fbfc4a30efef77a91be /src/lisp.h
parentf71afd600aef77d3c7248ae0e94b8c55fb2c5eb2 (diff)
downloademacs-15853707c8c36aff1d3cc19205971b88e04d007b.tar.gz
Default gcc -Og to inlining key ops
Problem reported by Martin Rudalics in: https://lists.gnu.org/r/emacs-devel/2020-04/msg00195.html * configure.ac (DEFINE_KEY_OPS_AS_MACROS): Define if -Og. * src/Makefile.in (KEY_OPS_CFLAGS): New macro. (EMACS_CFLAGS): Use it. * src/lisp.h (DEFINE_KEY_OPS_AS_MACROS): Let the gcc command line specify it. Remove use of undocumented INLINING macro.
Diffstat (limited to 'src/lisp.h')
-rw-r--r--src/lisp.h22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/lisp.h b/src/lisp.h
index f223814d8f3..7fc3af992e0 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -411,15 +411,19 @@ typedef EMACS_INT Lisp_Word;
# define lisp_h_XTYPE(a) ((enum Lisp_Type) (XLI (a) & ~VALMASK))
#endif
-/* When compiling via gcc -O0, define the key operations as macros, as
- Emacs is too slow otherwise. To disable this optimization, compile
- with -DINLINING=false. */
-#if (defined __NO_INLINE__ \
- && ! defined __OPTIMIZE__ && ! defined __OPTIMIZE_SIZE__ \
- && ! (defined INLINING && ! INLINING))
-# define DEFINE_KEY_OPS_AS_MACROS true
-#else
-# define DEFINE_KEY_OPS_AS_MACROS false
+/* When DEFINE_KEY_OPS_AS_MACROS, define key operations as macros to
+ cajole the compiler into inlining them; otherwise define them as
+ inline functions as this is cleaner and can be more efficient.
+ The default is true if the compiler is GCC-like and if function
+ inlining is disabled because the compiler is not optimizing or is
+ optimizing for size. Otherwise the default is false. */
+#ifndef DEFINE_KEY_OPS_AS_MACROS
+# if (defined __NO_INLINE__ \
+ && ! defined __OPTIMIZE__ && ! defined __OPTIMIZE_SIZE__)
+# define DEFINE_KEY_OPS_AS_MACROS true
+# else
+# define DEFINE_KEY_OPS_AS_MACROS false
+# endif
#endif
#if DEFINE_KEY_OPS_AS_MACROS