ghc-HEAD (only in -O -fllvm aka 'optllvm') prunes yield in -fno-omit-yields mode
Found on ./validate --slow today:
Unexpected failures:
concurrent/should_run T367_letnoescape [bad exit code] (optllvm)
# run manually:
$ LANG=C make fulltest stage=2 TEST=T367_letnoescape WAY=optllvm
=====> T367_letnoescape(optllvm) 2419 of 4083 [0, 0, 0]
cd ./concurrent/should_run && '/home/st/fun/ghc/inplace/bin/ghc-stage2' -fforce-recomp -dcore-lint -dcmm-lint -dno-debug-output -no-user-package-db -rtsopts -fno-ghci-history -o T367_letnoescape T367_letnoescape.hs -O -fllvm -fno-omit-yields >T367_letnoescape.comp.stderr 2>&1
cd ./concurrent/should_run && ./T367_letnoescape </dev/null >T367_letnoescape.run.stdout 2>T367_letnoescape.run.stderr
Timeout happened...killing process...
Wrong exit code (expected 0 , actual 99 )
Stdout:
Stderr:
*** unexpected failure for T367_letnoescape(optllvm)
I've loaded test in gdb and manually interrupted it:
^C
Program received signal SIGINT, Interrupt.
0x0000000000407110 in r5Wp_info ()
(gdb) disassemble
Dump of assembler code for function r5Wp_info:
0x00000000004070f8 <+0>: mov 0x358(%r13),%rax
0x00000000004070ff <+7>: dec %r14
0x0000000000407102 <+10>: data32 data32 data32 data32 nopw %cs:0x0(%rax,%rax,1)
=> 0x0000000000407110 <+24>: inc %r14
0x0000000000407113 <+27>: test %rax,%rax
0x0000000000407116 <+30>: jne 0x407110 <r5Wp_info+24>
0x0000000000407118 <+32>: mov -0x8(%r13),%rax
0x000000000040711c <+36>: mov $0x8e0690,%ebx
0x0000000000407121 <+41>: jmpq *%rax
End of assembler dump
Here we see 3 instructions-long dead loop.
llvm-3.4.2, amd64-linux.
Looks like yield code was not emitted or was moved away.