[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: DJGPP only dumps with USE_LISP_UNION_TYPE ??

From: Jan D.
Subject: Re: DJGPP only dumps with USE_LISP_UNION_TYPE ??
Date: Tue, 09 Nov 2004 11:25:22 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.1) Gecko/20040707

Eli Zaretskii wrote:

Emacs fatal error: buffer.c:4944: assertion failed: XTYPE (&buffer_defaults) == 0

In gdb I see that &buffer_local_symbols which is what Vbuffer_local_symbols uses, isn't aligned to an even 8 either. These are aligned to an even 4. So DECL_ALIGN isn't working in this configuration (?). Sounds strange.

Could you write a short test program that demonstrates whether
DECL_ALIGN works, and see if it fails on XP?  (I could run it on my
machine to see if it works on 98, which I think it does.)  If
DECL_ALIGN doesn't work, we certainly cannot use LSB tags in the XP
build.  We could then make the test program part of config.bat to DTRT
at build time.

Please also upgrade to a newer GCC version (I use 3.3.3), in case
there's some alignment bug in your version.

Test program attached. Output when compiling in Cygwin, Gnu/Linux or MacOSX is as expected:

ss1: rem 0
ss2: rem 0
ss3: rem 0
ss4: rem 0

but for djgpp (didn't find gcc 3.3.3, but 3.3.4):

D:\src>gcc -v
Reading specs from d:/djgpp/bin/../lib/gcc-lib/djgpp/3.34/specs
Configured with: /gcc/gnu/gcc-3.34/configure djgpp --prefix=/dev/env/DJDIR --dis
Thread model: single
gcc version 3.3.4

D:\src>make align
gcc     align.c   -o align

ss1: rem 4
ss2: rem 4
ss3: rem 4
ss4: rem 4

Very strange, considering Gnu/Linux and Cygwin are on the same machine.

        Jan D.

#include <stdio.h>

#define GCTYPEBITS 3
#  define DECL_ALIGN(type, var) \
    type __attribute__ ((__aligned__ (1 << GCTYPEBITS))) var

struct SS
  char *ptr;
  long nr;

DECL_ALIGN (struct SS, ss1);
DECL_ALIGN (struct SS, ss2);
DECL_ALIGN (struct SS, ss3);
DECL_ALIGN (struct SS, ss4);

main ()
  int rem;

  rem = (unsigned long)&ss1 % 8;
  printf ("ss1: rem %d\n", rem);
  rem = (unsigned long)&ss2 % 8;
  printf ("ss2: rem %d\n", rem);
  rem = (unsigned long)&ss3 % 8;
  printf ("ss3: rem %d\n", rem);
  rem = (unsigned long)&ss4 % 8;
  printf ("ss4: rem %d\n", rem);

  return 0;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]