On Nov 20, 2021, at 08:45:38, Phil Smith III wrote: > > Mario Bezzi wrote about inline assembler being optimized out of existence. > > Seems APARable, no? > That's perfectly reasonable behavior for peephole optimization which detects otiose instructions. Why should it preserve "BCR 0,0"?
This is the rationale for C's "volatile" storage class. References to volatile objects must not be moved out of loops; they might be accesses to hardware registers. I had a co-worker who complained of an Intel assembler's substituting a faster branch instruction, breaking his intended CPU timing loop. I have worked with a language that had a "legalnotice" keyword which protected otherwise unreferenced copyright strings from elimination by optimization. -- gil
