[Bug regression/91185] -Og miscompiles code causing runtime segfault

2019-07-16 Thread david.bolvansky at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91185

Dávid Bolvanský  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |INVALID

--- Comment #2 from Dávid Bolvanský  ---
Ok, it seems this is not a miscompilation. Just -O1 and higher hides bug in the
code (no segfault).

[Bug regression/91185] -Og miscompiles code causing runtime segfault

2019-07-16 Thread david.bolvansky at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91185

--- Comment #1 from Dávid Bolvanský  ---
(gdb) r bw
Starting program: /home/xbolva00/IFJ16/src/ifj16c bw

Program received signal SIGSEGV, Segmentation fault.
0xeac5 in eval (op=0x55768b80) at interpret.c:37
37  tVar *a = op->offset + frame_stack.top->frame->local;
(gdb) disassemble
Dump of assembler code for function eval:
   0xeab9 <+0>: test   %rdi,%rdi
   0xeabc <+3>: je 0xeaf4 
   0xeabe <+5>: mov0x205d8b(%rip),%rax#
0x55764850 
=> 0xeac5 <+12>:mov(%rax),%rsi
   0xeac8 <+15>:mov0x10(%rdi),%edx
   0xeacb <+18>:movslq %edx,%rax