I agree that the programmer should be allowed to use “and”/“or” instead of “and then”/“or else”, when the latter is not required by the case at hand. I would assume that the option -gnatyB is intended for use with stringent condition-coverage testing (MC/DC coverage) where using “and then”/“or else” may reduce the number of test cases required.
Modern processors do all sorts of optimizations during execution, and short-circuit logic usually requires turning them off. As a result, unnecessary use of short-circuit forms can result in slower code.
This isn’t true for all modern processors. They still design many “what you see is what you get” style processors as well today. Additionally many processors that do optimize can also sometimes incorporate branch prediction optimizations now. In some cases intentionally trying to avoid short circuit can also lead to less optimized code. Technology has gotten really varied and complex.
2 Likes