From: Eli Zaretskii <eliz@gnu.org>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: 8546@debbugs.gnu.org
Subject: bug#8546: fix for Emacs pseudovector incompatibility with GCC 4.6.0
Date: Mon, 25 Apr 2011 13:23:13 +0300 [thread overview]
Message-ID: <83oc3uaaum.fsf@gnu.org> (raw)
In-Reply-To: <4DB525C6.5020705@cs.ucla.edu>
> Date: Mon, 25 Apr 2011 00:41:58 -0700
> From: Paul Eggert <eggert@cs.ucla.edu>
>
> #define XSETPSEUDOVECTOR(a, b, code) \
> (XSETVECTOR (a, b), \
> eassert ((XVECTOR (a)->size & (PSEUDOVECTOR_FLAG | PVEC_TYPE_MASK)) \
> == (PSEUDOVECTOR_FLAG | (code))))
>
> Here's the generated x86 code, with the problem highlighted:
>
> movl $buffer_local_symbols, %eax
> movl $1, %edx
> call reset_buffer_local_variables
> movl $buffer_defaults, %eax
> orl $5, %eax
> movl %eax, Vbuffer_defaults
> andl $-8, %eax
> 0=> movl (%eax), %eax
> 1=> orl $1073872896, buffer_defaults
> movl $buffer_defaults+8, buffer_defaults+76
> andl $1082129920, %eax
> 2=> cmpl $1073872896, %eax
> movl $buffer_local_symbols+8, buffer_local_symbols+76
> movl $0, buffer_defaults+64
> movl $0, buffer_local_symbols+64
> je .L2396
> movl suppress_checking, %eax
> testl %eax, %eax
> je .L2398
> .L2396:
>
> The code marked (1) implements the expansion of XSETPVECTYPE, and sets
> buffer_defaults.size to 0x40020000, the mark for a buffer. The code
> marked (2) is part of the expansion of the eassert, and it checks that
> XVECTOR (Vbuffer_defaults)->size has the proper flag and code. But
> (2) is relying on a *cached* copy of the size, which was loaded in (0),
> and (0) precedes (1). So, the assertion fails.
Could you please tell more what is it in the Emacs macros that
triggers this problem? You say that "Emacs's pseudovector
implementation dissembles about the types", but could you please point
out where in the code this happens? I'm afraid I don't see it, but
then I'm no expert on compiler optimizations and on how they interact
with C types.
TIA
next prev parent reply other threads:[~2011-04-25 10:23 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-25 7:41 bug#8546: fix for Emacs pseudovector incompatibility with GCC 4.6.0 Paul Eggert
2011-04-25 10:23 ` Eli Zaretskii [this message]
2011-04-25 19:30 ` Paul Eggert
2011-04-25 14:05 ` Stefan Monnier
2011-04-25 23:12 ` Paul Eggert
2011-04-26 12:46 ` Stefan Monnier
2011-04-26 20:06 ` Paul Eggert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83oc3uaaum.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=8546@debbugs.gnu.org \
--cc=eggert@cs.ucla.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.