This archive contains the files necessary to reproduce the bug.
Files were generated as follows:
glslangValidator -V shader.frag -o shader.spv
spirv-opt shader.spv -o partlyoptimized.spv --eliminate-dead-branches --inline-entry-points-exhaustive
spirv-opt partlyoptimized.spv -o bad.spv --eliminate-dead-code-aggressive
Applying spirv-dis to bad.spv, we see that this block:
%43 = OpLabel
OpUnreachable
is reachable. It was not reachable in partlyoptimized.spv (in that binary it exists but has no incoming edges).
spirv-opt --version
SPIRV-Tools v2018.6-dev v2018.5-83-g1c1e749f
Found using GraphicsFuzz.