emacs-devel
[Top][All Lists]
Advanced

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

Re: (select-window nil) crash with gcc-8.2.0


From: Paul Eggert
Subject: Re: (select-window nil) crash with gcc-8.2.0
Date: Sun, 7 Apr 2019 11:33:22 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1

I reproduced the bug with GCC 8.3.1 20190223 (Red Hat 8.3.1-2) on x86-64. It's clearly a compiler bug with -O2 -Os. The machine code for select_window starts this way:

select_window:
        pushq   %r13
        movl    %edx, %r13d
        pushq   %r12
        pushq   %rbp
        movq    %rsi, %rbp
        pushq   %rbx
        movq    %rdi, %rbx
        pushq   %rcx
        call    WINDOWP
        movq    75(%rbx), %r12
        xorl    %edi, %edi
        testb   %al, %al
        je      .L981

and that last movq dereferences the window pointer in %rbx before the result of WINDOWP is checked to verify that the argument (originally in %rdi, now in %rbx) is indeed a window.

Could you file a GCC bug report for this? And in the meantime, I wouldn't use 
-Os.



reply via email to

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