Suspicious use volatile qualified variable in Clang codegen tests

Hi! I expanded unsequence check in Clang and found suspicious use volatile qualified variable in several tests:
\clang\test\CodeGen\PowerPC\builtins-ppc-fma.c
\clang\test\CodeGen\PowerPC\builtins-ppc-fpconstrained.c
For C and C++ standards order of evaluate funcall argument is unsequence(or indeterminate sequence) and unsequence access for same volatile variable is UB, but I don’t know if that extends to this compiler builtin.

Example from builtins-ppc-fma.c:

volatile vec_float vf;

void test_fma(void) {
vf = __builtin_vsx_xvmaddasp(vf, vf, vf);
…
}

Is it correct reworking them like this?

volatile vec_float vf, vf1, vf2, vf3;

void test_fma(void) {
vf = __builtin_vsx_xvmaddasp(vf1, vf2, vf3);
…
}

Volatile forces explicit loads and stores, so I would just expect this to be three separate loads in arbitrary order followed by one store. The reads are unsequenced, but there’s no side-effects without a write, which only happens at the end, which is sequenced. I’m not a language lawyer though.

I far I understand, according C\C++ standards, read volatile qualified variable is already side-effects.

I think you can ignore the possibility of the built-in having any special semantics that suppresses the undefined behaviour from unsequenced side effects on the same memory location.

Hi! I created PR that fixes these tests. Could someone familiar with powerPC please review PR.