Skip to content

GC+atomics and features #7184

@kripken

Description

@kripken
(module
 (type $0 (struct (field i32)))
 (type $1 (func (result i32)))
 (func $0 (result i32)
  (struct.atomic.get $0 0
   (struct.new_default $0)
  )
 )
)

This validates with --enable-gc --enable-shared-everything --enable-reference-types: GC for structs, shared-all for the new atomic operation there, and references as a dependency of GC. However, adding --heap2local will cause an atomic.fence to be emitted, and that requires --enable-threads, so this errors:

$ wasm-opt w.wasm --enable-gc --enable-shared-everything --enable-reference-types --heap2local
[wasm-validator error in function 0] unexpected false: Atomic operations require threads [--enable-threads], on 
(atomic.fence)
Fatal: error after opts

Should struct.atomic.* require --enable-threads? Or is this intentionally separate, and so we should avoid emitting atomic.fence here? @tlively

Metadata

Metadata

Assignees

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