Skip to content

spirv-opt: --eliminate-dead-code-aggressive can make OpUnreachable reachable #2018

@afd

Description

@afd

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions