emacs-devel
[Top][All Lists]
Advanced

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

Re: Error with -O3 but not -O2: "Wrong type argument: listp".


From: David Koppelman
Subject: Re: Error with -O3 but not -O2: "Wrong type argument: listp".
Date: Sun, 29 Jan 2006 12:12:29 -0600
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

I've re-done the builds at -O2 with -O3 optimizations specified
individually.  Build fails with "-g -O2 -finline-functions" but
succeeds with the other -O3 optimizations. I also re-built with plain
-O3 and -O2 optimizations to verify that the error would and would not
occur at these levels.  (I've listed the variations further below.)

I also tried using -finline-functions at -O0 and -O1, and those builds
worked. I'm not familiar with Emacs' internals but if I had to guess
I'd say this either means that there is a compiler bug which is
encountered with inlining and some -O2 optimization or that there is a
timing issue that's only encountered when Emacs executes very quickly.

I did try using gdb to locate the source of the segmentation fault
but gdb was complaining about threads: 

    (gdb) run --batch --load loadup bootstrap
    Starting program: /fac/drk/localpri/build/emacs/src/temacs --batch --load 
loadup bootstrap
    [Thread debugging using libthread_db enabled]
    [New Thread -1208084800 (LWP 14053)]
    Cannot find user-level thread for LWP 14053: generic error
    (gdb) quit

I'll try getting gdb to work, I'd appreciate a hint about the gdb
error. (gdb works fine with other programs that I've debugged.)


With the following compile options bootstrap fails:

    CFLAGS="-g -O3"
    CFLAGS="-g -O2 -finline-functions"

With the following compile options bootstrap reaches byte compiling,
at which time I usually interrupt the build and try another
configuration.  I allowed "-g -O2 -fweb -frename-registers" to reach
completion and am using it now.

    CFLAGS="-g -O2 -fweb"
    CFLAGS="-g -O2 -frename-registers"
    CFLAGS="-g -O0 -finline-functions"
    CFLAGS="-g -O1 -finline-functions"
    CFLAGS="-g -O2 -fweb -frename-registers"

Here is a typical build failure:

    ./temacs --batch --load loadup bootstrap
    Loading loadup.el (source)...
    Using load-path (/fac/drk/localpri/build/emacs/lisp 
/fac/drk/localpri/build/emacs/lisp/emacs-lisp 
/fac/drk/localpri/build/emacs/lisp/language 
/fac/drk/localpri/build/emacs/lisp/international 
/fac/drk/localpri/build/emacs/lisp/textmodes)
    Loading emacs-lisp/byte-run (source)...
    Wrong type argument: listp, []
    gmake[2]: *** [bootstrap-emacs] Error 255
    gmake[2]: Leaving directory `/fac/drk/localpri/build/emacs/src'
    gmake[1]: *** [bootstrap-build] Error 2
    gmake[1]: Leaving directory `/fac/drk/localpri/build/emacs'
    gmake: *** [bootstrap] Error 2

Eli Zaretskii <address@hidden> writes:

>> From: David Koppelman <address@hidden>
>> Date: Sat, 28 Jan 2006 15:17:14 -0600
>> 
>>     `-O3'
>>          Optimize yet more.  `-O3' turns on all optimizations specified by
>>          `-O2' and also turns on the `-finline-functions', `-fweb' and
>>          `-frename-registers' options.
>> 
>> I can try compiling at -O2 and try out one of the -O3 optimizations at
>> a time, if that would help.
>
> Yes, try that and see which one is the culprit.
>
> Also, it would be useful to run under GDB and see where does Emacs
> barf, then compare the machine code between this and the -O2 binary.
> We probably have some buggy C code somewhere, or else there's a GCC
> bug.




reply via email to

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