Skip to content

Undropped br_ifs in block.wast test? #343

@kripken

Description

@kripken

In binary_0xc the block test has

  (func (export "break-repeated") (result i32)
    (block i32
      (br 0 (i32.const 18))
      (br 0 (i32.const 19))
      (br_if 0 (i32.const 20) (i32.const 0))
      (br_if 0 (i32.const 20) (i32.const 1))
      (br 0 (i32.const 21))
      (br_table 0 (i32.const 22) (i32.const 4))
      (br_table 0 0 0 (i32.const 23) (i32.const 1))
      (i32.const 21)
    )
  )

Since br_if now returns its value, those br_ifs should normally be dropped, I believe. I guess the reason they aren't dropped here is br clearing the stack?

If that's the case, then I'd like to propose moving such tests to stack.wast. The motivation is that Binaryen doesn't intend to support such "stacky" code (as it doesn't fit well with its internal optimization IR). We would like to pass the test suite sans stack.wast, basically. (So far I've maintained a list of such code in other tests, to ignore them, but I can only ignore a whole module, and in the case here, that means ignoring a lot of non-stacky parts.) If that sounds ok I can make a PR.

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