[PATCH] D118297: [clang] add Diag -Wasm-volatile for implied volatile asm stmts
James Y Knight via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Jan 31 12:57:54 PST 2022
jyknight added a comment.
I agree that's the expected semantics. I think those semantics are unfortunate, but they're not gonna change. IMO it would've been better if you had to opt-in to "no side effects" via `__attribute__((const))` or so.
But I wonder why you think we should be discouraging people from writing "asm volatile" for things that are implicitly treated as having side-effects? It's quite non-obvious that adding an output argument to an existing asm statement changes whether it's treated as having side-effects, and I don't think it improves a codebase to make people lay out that trap more more frequently.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D118297/new/
https://reviews.llvm.org/D118297
More information about the cfe-commits
mailing list