From 8881986b3e227f46d8a7d6766b41802bcfc2517c Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 8 Oct 2014 23:54:10 -0700 Subject: [PATCH] * lisp.h (USE_STACK_STRING): Now true only if USE_STACK CONS. On x86 platforms this works around GCC bug 63495 , and more generally should fix a portability problem in Emacs. Problem reported by Stefan Monnier in: http://lists.gnu.org/archive/html/emacs-devel/2014-10/msg00261.html --- src/ChangeLog | 9 +++++++++ src/lisp.h | 7 +++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index e01c70f3dce..a38df05518d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2014-10-09 Paul Eggert + + * lisp.h (USE_STACK_STRING): Now true only if USE_STACK CONS. + On x86 platforms this works around GCC bug 63495 + , + and more generally should fix a portability problem in Emacs. + Problem reported by Stefan Monnier in: + http://lists.gnu.org/archive/html/emacs-devel/2014-10/msg00261.html + 2014-10-08 Leo Liu Enhance terpri to allow conditionally output a newline. (Bug#18652) diff --git a/src/lisp.h b/src/lisp.h index 0425744b301..9e4cc5fdc53 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -4615,13 +4615,16 @@ union Aligned_String double d; intmax_t i; void *p; }; -/* True for stack-based cons and string implementations. */ +/* True for stack-based cons and string implementations, respectively. + Use stack-based strings only if stack-based cons also works. + Otherwise, STACK_CONS would create heap-based cons cells that + could point to stack-based strings, which is a no-no. */ enum { USE_STACK_CONS = (USE_STACK_LISP_OBJECTS && alignof (union Aligned_Cons) % GCALIGNMENT == 0), - USE_STACK_STRING = (USE_STACK_LISP_OBJECTS + USE_STACK_STRING = (USE_STACK_CONS && alignof (union Aligned_String) % GCALIGNMENT == 0) }; -- 2.39.5