emacs-devel
[Top][All Lists]
Advanced

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

Re: make check fails? (emacs-26.1 w/modules)


From: Greg Minshall
Subject: Re: make check fails? (emacs-26.1 w/modules)
Date: Tue, 04 Sep 2018 13:39:54 +0300

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 <module_assert_thread>
   0x0000000000592379 <+9>:     cmpb   $0x0,0x66ae08(%rip)        # 0xbfd188 
<module_assertions>
   0x0000000000592380 <+16>:    je     0x59238a <module_intern+26>
   0x0000000000592382 <+18>:    mov    %rbx,%rdi
   0x0000000000592385 <+21>:    callq  0x592240 <module_assert_env>
   0x000000000059238a <+26>:    mov    %rbx,%rdi
   0x000000000059238d <+29>:    callq  0x592340 <module_non_local_exit_check>
   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



reply via email to

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