On 3/3/24 19:56, HAO CHEN GUI wrote:
Hi Jeff,
   Thanks for your comments.

在 2024/3/4 6:02, Jeff Law 写道:
Why specifically are you worried here?  Propagation of a volatile shouldn't in 
and of itself cause a problem.  We're not changing the number of volatile 
accesses or anything like that -- we're just moving them around a bit.

If the volatile asm operand is in a parallel set, it can't be eliminated
after the propagation. So the define insn and use insn will execute the
volatile asm block twice. That's the problem.
Thanks.  That's a key piece of information.


Here is a real case from sanitizer_linux.cpp. The insn 62 has a volatile
asm operands and it is propagated into insn 60. After propagation both
insn 60 and 62 has the volatile asm operand. Thus asm block will be
executed for twice. It causes sanitizer behaves abnormally in my test.
Understood. So the key is that if we propagate an operand, but are unable to eliminate the original insn, then we can evaluate the operand (in this case an ASM) more than once?

Can the same thing happen with a volatile memory load? I don't think that will be caught by the volatile_insn_p check.


Jeff

Reply via email to