An asm statement with side effects gets lost when compiling with O1 or higher.
Created attachment 11731 [details] test case This test case should fail to assemble. Yet it does at -O1 or higher.
__asm__ ("choke_me %0 %1 %2" : "+m" (*p1), "+m" (*p2), "+m" (*p3)); *p1 = val0; *p2 = val0; *p3 = val0; Actually I don't think so since the asm is dead code as the stores to *p1, *p2, and *p3 are dead by the next couple of statements.
(In reply to comment #2) > __asm__ ("choke_me %0 %1 %2" : "+m" (*p1), "+m" (*p2), "+m" (*p3)); > *p1 = val0; > *p2 = val0; > *p3 = val0; > > Actually I don't think so since the asm is dead code as the stores to *p1, *p2, > and *p3 are dead by the next couple of statements. Hmm, that's true.