From b20477727bdf1351636d718c41a6eb9035b26f3f Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 5 Sep 2025 15:43:32 -0700 Subject: [PATCH 1/2] fix --- src/tools/wasm-reduce/wasm-reduce.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/wasm-reduce/wasm-reduce.cpp b/src/tools/wasm-reduce/wasm-reduce.cpp index cf5855274d7..d69d698b601 100644 --- a/src/tools/wasm-reduce/wasm-reduce.cpp +++ b/src/tools/wasm-reduce/wasm-reduce.cpp @@ -279,7 +279,7 @@ struct Reducer "--dce", "--duplicate-function-elimination", "--enclose-world", - "--gto", + "--gto --closed-world", "--inlining", "--inlining-optimizing", "--optimize-level=3 --inlining-optimizing", From 080a6d954337e0f9ad50696d03b8682afaa708dc Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Mon, 8 Sep 2025 12:25:33 -0700 Subject: [PATCH 2/2] update test --- test/reduce/gc.wast | 1 + test/reduce/gc.wast.txt | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/test/reduce/gc.wast b/test/reduce/gc.wast index 98d1cd07545..52756d4fc7a 100644 --- a/test/reduce/gc.wast +++ b/test/reduce/gc.wast @@ -1,5 +1,6 @@ (module (rec + ;; The funcref field can be optimized away with --gto. (type $A (struct (field (mut i32)) (field funcref))) ;; This type can be optimized away. (type $unused (struct)) diff --git a/test/reduce/gc.wast.txt b/test/reduce/gc.wast.txt index 3af5287ce99..1fcf771c205 100644 --- a/test/reduce/gc.wast.txt +++ b/test/reduce/gc.wast.txt @@ -1,5 +1,5 @@ (module - (type $0 (struct (field (mut i32)) (field funcref))) + (type $0 (struct (field (mut i32)))) (type $1 (func (result i32))) (global $global$0 (ref null $0) (struct.new_default $0)) (export "use-global" (func $0))