https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96235
Joseph C. Sible <josephcsible at gmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |josephcsible at gmail dot com --- Comment #2 from Joseph C. Sible <josephcsible at gmail dot com> --- I can reproduce it on godbolt ("Program returned: 139"): https://godbolt.org/z/c7eYzx Here's the assembly output: main: movslq b(%rip), %rax cmpq 0, %rax cmpq $0, d(%rip) movl $0, %eax ret c: .quad 1 d: .quad 1 b: .long 1 The problem is that "cmpq 0, %rax" tries to read memory at address 0.