From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Greg Minshall Newsgroups: gmane.emacs.devel Subject: Re: make check fails? (emacs-26.1 w/modules) Date: Tue, 04 Sep 2018 13:39:54 +0300 Message-ID: <12105.1536057594@minshall-apollo.minshall.org> References: <83efeazkal.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1536057534 6139 195.159.176.226 (4 Sep 2018 10:38:54 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 4 Sep 2018 10:38:54 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 04 12:38:50 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fx8jR-0001MO-0h for ged-emacs-devel@m.gmane.org; Tue, 04 Sep 2018 12:38:49 +0200 Original-Received: from localhost ([::1]:50149 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fx8lS-00061v-2Q for ged-emacs-devel@m.gmane.org; Tue, 04 Sep 2018 06:40:54 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41234) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fx8kj-0005zV-5q for emacs-devel@gnu.org; Tue, 04 Sep 2018 06:40:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fx8ki-0002Zh-4d for emacs-devel@gnu.org; Tue, 04 Sep 2018 06:40:09 -0400 Original-Received: from hiwela.pair.com ([209.68.5.201]:23211) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fx8ka-0002Tu-Ut; Tue, 04 Sep 2018 06:40:01 -0400 Original-Received: from hiwela.pair.com (localhost [127.0.0.1]) by hiwela.pair.com (Postfix) with ESMTP id 013C99804E3; Tue, 4 Sep 2018 06:40:00 -0400 (EDT) Original-Received: from minshall-entroware-apollo.cliq.com (unknown [78.179.75.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by hiwela.pair.com (Postfix) with ESMTPSA id 8DB4E8F082E; Tue, 4 Sep 2018 06:39:59 -0400 (EDT) Original-Received: from minshall-apollo.minshall.org (localhost [127.0.0.1]) by minshall-entroware-apollo.cliq.com (Postfix) with ESMTP id E468C6C0256; Tue, 4 Sep 2018 13:39:54 +0300 (+03) In-reply-to: Your message of "Mon, 03 Sep 2018 18:13:06 +0300." <83efeazkal.fsf@gnu.org> X-Mailer: MH-E 8.6+git; nmh 1.6; GNU Emacs 26.1 Content-ID: <12104.1536057594.1@minshall-apollo.minshall.org> X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x X-Received-From: 209.68.5.201 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:229224 Archived-At: um, err. you know how it is. you're gdb'ing through ./src, setting breakpoints, examining data, getting a sense of the control flow, generally having a grand old time. but, it's hard, and getting annoying, trying to see, navigate, through the optimizer. so, you change src/Makefile's CFLAGS to remove the -O2, touch the file you're currently looking at -- which just happened to be src/emacs-module.c -- recompile, start up gdb again, and ---- make[3]: Leaving directory '/home/minshall/src/import/emacs/git/emacs/test= ' SUMMARY OF TEST RESULTS ----------------------- Files examined: 186 Ran 2601 tests, 2582 results as expected, 19 skipped make[2]: Leaving directory '/home/minshall/src/import/emacs/git/emacs/test= ' make[1]: Leaving directory '/home/minshall/src/import/emacs/git/emacs/test= ' ---- so, the optimizer. i turned back on -O2, recompiled emacs-module.c, and asked gdb to kindly disassemble module_intern() for me (as that function was on the path i was ascending): ---- (gdb) disassemble module_intern Dump of assembler code for function module_intern: 0x0000000000592370 <+0>: push %rbx 0x0000000000592371 <+1>: mov %rdi,%rbx 0x0000000000592374 <+4>: callq 0x592180 0x0000000000592379 <+9>: cmpb $0x0,0x66ae08(%rip) # 0xbfd1= 88 0x0000000000592380 <+16>: je 0x59238a 0x0000000000592382 <+18>: mov %rbx,%rdi 0x0000000000592385 <+21>: callq 0x592240 0x000000000059238a <+26>: mov %rbx,%rdi 0x000000000059238d <+29>: callq 0x592340 0x0000000000592392 <+34>: xor %eax,%eax 0x0000000000592394 <+36>: pop %rbx 0x0000000000592395 <+37>: retq End of assembler dump. ---- well, *that's* definitely optimized. here's my compiler: ---- bash minshall-apollo: {1294} gcc --version gcc (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609 Copyright (C) 2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE= . ---- admittedly pretty old, but that's apparently what ubuntu's serving up these days. i guess it's always possible the optimizer is doing the right thing because of some programming error, maybe a mis-placed "const" on an extern, something like that. cheers, Greg