From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Koppelman Newsgroups: gmane.emacs.devel Subject: Re: Error with -O3 but not -O2: "Wrong type argument: listp". Date: Sun, 29 Jan 2006 12:12:29 -0600 Message-ID: <7wu0bm7vjm.fsf@ece.lsu.edu> References: <7wy810kq79.fsf@ece.lsu.edu> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1138559369 1113 80.91.229.2 (29 Jan 2006 18:29:29 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 29 Jan 2006 18:29:29 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 29 19:29:29 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1F3HIb-0004nE-7A for ged-emacs-devel@m.gmane.org; Sun, 29 Jan 2006 19:29:17 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F3HLW-0003Qx-8F for ged-emacs-devel@m.gmane.org; Sun, 29 Jan 2006 13:32:18 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1F3H5X-0000xJ-3e for emacs-devel@gnu.org; Sun, 29 Jan 2006 13:15:47 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1F3H5U-0000vE-CR for emacs-devel@gnu.org; Sun, 29 Jan 2006 13:15:44 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F3H5T-0000ui-3f for emacs-devel@gnu.org; Sun, 29 Jan 2006 13:15:43 -0500 Original-Received: from [130.39.223.71] (helo=ece.lsu.edu) by monty-python.gnu.org with esmtp (Exim 4.52) id 1F3H3Z-0005RS-S1; Sun, 29 Jan 2006 13:13:46 -0500 Original-Received: from nested.ece.lsu.edu (nested [130.39.222.143]) by ece.lsu.edu (8.11.7p1+Sun/8.11.7) with ESMTP id k0TIBqU05123; Sun, 29 Jan 2006 12:11:52 -0600 (CST) Original-Received: from nested.ece.lsu.edu (localhost [127.0.0.1]) by nested.ece.lsu.edu (8.13.1/8.13.1) with ESMTP id k0TICTqU017383; Sun, 29 Jan 2006 12:12:30 -0600 Original-Received: (from koppel@localhost) by nested.ece.lsu.edu (8.13.1/8.13.1/Submit) id k0TICTWL017382; Sun, 29 Jan 2006 12:12:29 -0600 Original-To: Eli Zaretskii In-Reply-To: (Eli Zaretskii's message of "Sun, 29 Jan 2006 06:50:16 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:49688 Archived-At: 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 writes: >> From: David Koppelman >> 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.