summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/asm2wasm.h1
-rw-r--r--test/emcc_hello_world.fromasm2
-rw-r--r--test/emcc_hello_world.fromasm.imprecise2
-rw-r--r--test/wasm-only.fromasm1
-rw-r--r--test/wasm-only.fromasm.imprecise1
5 files changed, 1 insertions, 6 deletions
diff --git a/src/asm2wasm.h b/src/asm2wasm.h
index fe9bd0f3f..34825eb61 100644
--- a/src/asm2wasm.h
+++ b/src/asm2wasm.h
@@ -1027,6 +1027,7 @@ void Asm2WasmBuilder::processAsm(Ref ast) {
passRunner.add("remove-unused-brs");
passRunner.add("optimize-instructions");
passRunner.add("post-emscripten");
+ passRunner.add("dce"); // make sure to not emit unreachable code
}
passRunner.run();
diff --git a/test/emcc_hello_world.fromasm b/test/emcc_hello_world.fromasm
index 1971f0c3b..690c869ca 100644
--- a/test/emcc_hello_world.fromasm
+++ b/test/emcc_hello_world.fromasm
@@ -6656,7 +6656,6 @@
)
)
)
- (br $__rjto$8)
)
(set_local $5
(call $_fmt_u
@@ -6886,7 +6885,6 @@
(br $__rjti$7)
)
)
- (br $__rjto$8)
)
(call $_pad
(get_local $0)
diff --git a/test/emcc_hello_world.fromasm.imprecise b/test/emcc_hello_world.fromasm.imprecise
index 4b429163d..2cd23ba1d 100644
--- a/test/emcc_hello_world.fromasm.imprecise
+++ b/test/emcc_hello_world.fromasm.imprecise
@@ -6642,7 +6642,6 @@
)
)
)
- (br $__rjto$8)
)
(set_local $5
(call $_fmt_u
@@ -6872,7 +6871,6 @@
(br $__rjti$7)
)
)
- (br $__rjto$8)
)
(call $_pad
(get_local $0)
diff --git a/test/wasm-only.fromasm b/test/wasm-only.fromasm
index a8d125d23..1a50a4385 100644
--- a/test/wasm-only.fromasm
+++ b/test/wasm-only.fromasm
@@ -359,7 +359,6 @@
(i32.const -2)
)
(return)
- (br $__rjto$0)
)
)
(i32.store
diff --git a/test/wasm-only.fromasm.imprecise b/test/wasm-only.fromasm.imprecise
index 0edb3e6c1..b7994d689 100644
--- a/test/wasm-only.fromasm.imprecise
+++ b/test/wasm-only.fromasm.imprecise
@@ -287,7 +287,6 @@
(i32.const -2)
)
(return)
- (br $__rjto$0)
)
)
(i32.store