On Sun, Jan 30, 2022 at 10:50:56AM +0000, Jonathan Wakely wrote: > We could put a trap instruction at the end of the function though, which > would make the result a bit less arbitrary. > > I've come around to thinking that's preferable for cases like this.
Depends on which exact cases. Because for int foo (int s) { if (s == 123) return 1; } we want to optimize it into return 1; rather than if (s == 123) return 1; else __builtin_trap (); For debugging we have -fsanitize=undefined Jakub