https://gcc.gnu.org/bugzilla/show_bug.cgi?id=40748
--- Comment #3 from Marc Glisse <glisse at gcc dot gnu.org> ---
We also miss the even simpler case that should be optimized to "return n;"
int foo(int n){
switch(n){
case 0:
return 0;
case 1:
return 1;
case 2:
return 2;
case 3:
return 3;
default:
__builtin_unreachable();
}
}
llvm performs the expected optimization in both cases.
