Open
Description
For #[align]
, see the error here and the discussion here. I assume this also affects -Zmin-function-align
.
In wasm, functions don't have an "address", it's not a von-Neumann architecture. Instead, there is a dedicated table and one can pick an integer index into the table when doing a dynamic call. So the actual address of a function cannot be observed and "aligning" it has no meaning. However, the fn ptr value can be observed by being cast to an integer, and then one will see the index into that table. One could attempt to align that but it seems not very useful...
Apart from the usefulness, I guess the question is what can we do?
- Error when the attribute is used on wasm, since relying on fn ptr being divisible by N will just not work
- Try to convince LLVM to implement this (is there an LLVM issue?)
Metadata
Metadata
Assignees
Labels
Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: alignment control (`repr(align(N))` and so on)Category: This is a bug.`#![feature(fn_align)]`Target: WASM (WebAssembly), http://webassembly.org/Relevant to the compiler team, which will review and decide on the PR/issue.Relevant to the language team