If the compiler were required to return an "unspecified value", you'll at least know that your code DID run (and generate an incorrect result).
input:
declare void @g()
define void @f() {
br i1 undef, label %if.end, label %if.else
if.else:
call void @g()
br label %if.end
if.end:
ret void
}
after optimizations: declare void @g()
define void @f() {
if.else:
tail call void @g()
ret void
}"Undefined behavior" means the compiler can do anything. In your example, the compiler could execute one statement but not the other. Or it could execute both of them fifteen times. Or it could reformat your hard drive, or start a war. All would be legal according to the spec. (Feasibility of implementing such things is, of course, another question.) The more mundane consequences are more likely to be what you actually see, but the point is that you can't really reason about it in the abstract. You have to know exactly how your particular compiler handles it, and it can go well beyond just executing your code in a funny way.
For one real-world that approaches "nasal demons", early versions of gcc would start a game of nethack if they encountered a #pragma statement in your program.
But I'm not really a C programmer, so feel free to correct me if I'm interpreting this wrong.