It seems gcc 2.95.2 does wrong optimization.
(emacs-version)
"XEmacs 21.2 (beta22) \"Mercedes\" [Lucid] (i686-pc-linux, Mule) of Sat
Dec 4 1999 on buck"
gcc -v
Reading specs from /usr/lib/gcc-lib/i386-linux/2.95.2/specs
gcc version 2.95.2 19991109 (Debian GNU/Linux)
When I evaluate (decode-buffer 1), XEmacs 21.2 crashes. When
I pass arguments other than integers or floats, it doesn't
crash. XEmacs 21.1 is fine.
Lisp backtrace follows:
decode-buffer(1)
eval((decode-buffer 1))
# bind (expr)
eval-interactive((decode-buffer 1))
# bind (standard-output opoint ignore-quotes eval-last-sexp-arg-internal)
eval-last-sexp(nil)
# bind (command-debug-status)
call-interactively(eval-last-sexp)
# (condition-case ... . error)
# (catch top-level ...)
First part of stacktrace is:
#0 0x403e25d1 in kill () from /lib/libc.so.6
#1 0x808e074 in fatal_error_signal (sig=11) at emacs.c:276
#2 0x403e2508 in sigaction () from /lib/libc.so.6
#3 0x806261b in Fdecode_buffer (buffer=3) at buffer.c:372
#4 0x8092c8d in Feval (form=139875680) at eval.c:2975
#5 0x80936a7 in Ffuncall (nargs=2, args=0xbffff388) at eval.c:3178
Crash happens in decode_buffer at buffer.c L357
if (allow_string && STRINGP (buffer))
return XBUFFER (get_buffer (buffer, 1));
It doesn't matter allow_string is 0 or 1. It always crashes
when checking the if statement. So I bet this is a compiler
bug. Can anyone reproduce this? If someone does, I'll report
this to gcc development team.
The only way for me to workaround this problem is to add
-no-gcse to cflags.
./configure --prefix=/opt/local '--cflags=-g -O3 -Wall -Wno-switch -fno-gcse'
seems OK.
uname -a: Linux buck 2.2.13 #2 Thu Nov 25 20:06:18 JST 1999 i686 unknown
./configure '--prefix=/opt/local' '--with-mule'
XEmacs 21.2-b22 "Mercedes" configured for `i686-pc-linux'.
Where should the build process find the source code? /src/xemacs
What installation prefix should install use? /opt/local
What operating system and machine description files should XEmacs use?
`s/linux.h' and `m/intel386.h'
What compiler should XEmacs be built with? gcc -g -O3 -Wall -Wno-switch
Should XEmacs use the GNU version of malloc? yes
(Using Doug Lea's new malloc from the GNU C Library.)
Should XEmacs use the relocating allocator for buffers? yes
What window system should XEmacs use? x11
Where do we find X Windows header files? /usr/X11R6/include
Where do we find X Windows libraries? /usr/X11R6/lib
Compiling in support for XAUTH.
Compiling in support for XPM images.
Compiling in support for PNG image handling.
Compiling in support for (builtin) GIF image handling.
Compiling in support for JPEG image handling.
Compiling in support for TIFF image handling.
Compiling in support for X-Face message headers.
Compiling in native sound support.
Compiling in support for Enlightened Sound Daemon.
Compiling in support for Berkeley DB.
Compiling in support for ncurses.
Compiling in Mule (multi-lingual) support.
Compiling in XIM (X11R5+ I18N input method) support.
Using raw Xlib to provide XIM support.
Compiling in support for proper WM_COMMAND handling.
Using Lucid menubars.
Using Lucid scrollbars.
Using Motif native widgets.
Using Motif dialog boxes.
Compiling in DSO module support.
movemail will use "dot-locking" for locking mail spool files.
Compiling in extra code for debugging.
WARNING: ---------------------------------------------------------
WARNING: Compiling in support for runtime error checking.
WARNING: XEmacs will run noticeably more slowly as a result.
WARNING: Error checking is on by default for XEmacs beta releases.
WARNING: ---------------------------------------------------------
--
Yoshiki Hayashi