https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81693

--- Comment #21 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
% /opt/gcc/gcc8w/bin/gcc /opt/gcc/work/gcc/testsuite/gcc.dg/torture/pr25967-1.c
-m32 -g
% lldb a.out
(lldb) target create "a.out"
Current executable set to 'a.out' (i386).
(lldb) run
Process 25578 launched:
'/Users/dominiq/Documents/Fortran/g95bench/win/f90/bug/a.out' (i386)
Process 25578 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS
(code=EXC_I386_GPFLT)
    frame #0: 0xa152b200 libdyld.dylib`misaligned_stack_error_
libdyld.dylib`misaligned_stack_error_:
->  0xa152b200 <+0>:  movdqa %xmm0, 0x10(%esp)
    0xa152b206 <+6>:  movdqa %xmm1, 0x20(%esp)
    0xa152b20c <+12>: movdqa %xmm2, 0x30(%esp)
    0xa152b212 <+18>: movdqa %xmm3, 0x40(%esp)
(lldb) b main
Breakpoint 1: where = a.out`main + 5 at pr25967-1.c:62, address = 0x00001f44
(lldb) run
There is a running process, kill it and restart?: [Y/n] y
Process 25578 exited with status = 9 (0x00000009) 
Process 25583 launched:
'/Users/dominiq/Documents/Fortran/g95bench/win/f90/bug/a.out' (i386)
Process 25583 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
    frame #0: 0x00001f44 a.out`main at pr25967-1.c:62
   59   main ()
   60   {
   61     /* Align exception handler stack to 16 bytes.  */
-> 62     asm ("and     $-16, %" STACK_POINTER ";       \
   63           push    $" STRING (SS) ";               \
   64           push    $" STRING (SP) ";               \
   65           push    $" STRING (FLAGS) ";            \
(lldb) disass -a 0x00001f44
a.out`main:
    0x1f3f <+0>:  calll  0x1f70                    ; __x86.get_pc_thunk.ax
->  0x1f44 <+5>:  andl   $-0x10, %esp
    0x1f47 <+8>:  pushl  $0x12345675               ; imm = 0x12345675 
    0x1f4c <+13>: pushl  $0x12345674               ; imm = 0x12345674 
    0x1f51 <+18>: pushl  $0x12345673               ; imm = 0x12345673 
    0x1f56 <+23>: pushl  $0x12345672               ; imm = 0x12345672 
    0x1f5b <+28>: pushl  $0x12345671               ; imm = 0x12345671 
    0x1f60 <+33>: pushl  $0x12345670               ; imm = 0x12345670 
    0x1f65 <+38>: jmp    0x1ed0                    ; fn at pr25967-1.c:38
    0x1f6a <+43>: movl   $0x0, %eax
    0x1f6f <+48>: retl   

% /opt/gcc/gcc8w/bin/gcc /opt/gcc/work/gcc/testsuite/gcc.dg/torture/pr25967-1.c
-g
% lldb ./a.out
(lldb) target create "./a.out"
Current executable set to './a.out' (x86_64).
(lldb) run
Process 25632 launched: './a.out' (x86_64)
Process 25632 exited with status = 0 (0x00000000) 
(lldb) b main
Breakpoint 1: where = a.out`main at pr25967-1.c:62, address =
0x0000000100000f4b
(lldb) run
Process 25636 launched: './a.out' (x86_64)
Process 25636 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
    frame #0: 0x0000000100000f4b a.out`main at pr25967-1.c:62
   59   main ()
   60   {
   61     /* Align exception handler stack to 16 bytes.  */
-> 62     asm ("and     $-16, %" STACK_POINTER ";       \
   63           push    $" STRING (SS) ";               \
   64           push    $" STRING (SP) ";               \
   65           push    $" STRING (FLAGS) ";            \
(lldb) disass -a 0x0000000100000f4b
a.out`main:
->  0x100000f4b <+0>:  andq   $-0x10, %rsp
    0x100000f4f <+4>:  pushq  $0x12345675               ; imm = 0x12345675 
    0x100000f54 <+9>:  pushq  $0x12345674               ; imm = 0x12345674 
    0x100000f59 <+14>: pushq  $0x12345673               ; imm = 0x12345673 
    0x100000f5e <+19>: pushq  $0x12345672               ; imm = 0x12345672 
    0x100000f63 <+24>: pushq  $0x12345671               ; imm = 0x12345671 
    0x100000f68 <+29>: pushq  $0x12345670               ; imm = 0x12345670 
    0x100000f6d <+34>: jmp    0x100000ed2               ; fn at pr25967-1.c:40
    0x100000f72 <+39>: movl   $0x0, %eax
    0x100000f77 <+44>: retq

Reply via email to