brunodf-snps wrote:

> Do we want nocapture markings on memory operands?

I had a chance to discuss this with @nikic and he brought up the LEA 
instruction. The following would capture the address the `b` field:

```
asm("lea %0, %1" : "=r" (r) : "m" (p[i].b));
```

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.

(*) I think an alternative could be:

```
asm("lea %0, %a1": "=r" (r) : "p" (&p[i].b));
```

But clang does not accept it: https://godbolt.org/z/33Mxe9nvd

https://github.com/llvm/llvm-project/pull/110510
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to