GNU bug report logs -
#8546
fix for Emacs pseudovector incompatibility with GCC 4.6.0
Previous Next
Reported by: Paul Eggert <eggert <at> cs.ucla.edu>
Date: Mon, 25 Apr 2011 07:43:02 UTC
Severity: normal
Done: Paul Eggert <eggert <at> cs.ucla.edu>
Bug is archived. No further changes may be made.
Full log
Message #8 received at 8546 <at> debbugs.gnu.org (full text, mbox):
> Date: Mon, 25 Apr 2011 00:41:58 -0700
> From: Paul Eggert <eggert <at> 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
This bug report was last modified 14 years and 31 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.