[clang] [clang][CodeGen] Emit improved memory effects and return status for AsmStmt (PR #110510)

Eli Friedman via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 30 17:53:43 PDT 2024


efriedma-quic wrote:

> I could not find back if you are allowed to use an inline assembly memory operand for such an instruction (*), but it certainly seems a real risk that users are doing this.

Tried some quick tests; in the following, gcc doesn't eliminate the load:

```
int f(int *rr) {
    int a = 10;
    int *r;
    asm("leaq %1, %0" : "=r" (r) : "m" (a));
    *r = 20;
    return a;
}
```

So I guess we should do the same thing.

https://github.com/llvm/llvm-project/pull/110510


More information about the cfe-commits mailing list