Skip to content

[WebAssembly] ICE when using __builtin_thread_pointer #117433

@kleisauke

Description

@kleisauke

test.c:

void *f0(void)
{
#if __has_builtin(__builtin_thread_pointer)
  return __builtin_thread_pointer();
#else
  return 0;
#endif
}
$ /emsdk/upstream/bin/clang --target=wasm32 --no-standard-libraries -Wl,--no-entry -Wl,--export-all -o test.wasm test.c
fatal error: error in backend: Cannot select: intrinsic %llvm.thread.pointer
clang: error: clang frontend command failed with exit code 70 (use -v to see invocation)
clang version 20.0.0git (https:/github.com/llvm/llvm-project 3a31427224d4fa49d7ef737b21f6027dc4928ecf)
Target: wasm32
Thread model: posix
InstalledDir: /emsdk/upstream/bin
Build config: +assertions
clang: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /tmp/test-9adbd1.c
clang: note: diagnostic msg: /tmp/test-9adbd1.sh
clang: note: diagnostic msg: 

********************

Context: emscripten-core/emscripten#21548.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions