https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102927

--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
(In reply to Gabriel Ravier from comment #0)
> int foo(int i) {
>   if (i == 0)
>     return 52;
>   else if (i == 1)
>     return 77;
>   else if (i == 2)
>     return 91;
>   else if (i == 3)
>     return 10;
>   else
>     return 42;
> }
> 

As Richi said, we do the transformation to switch only if we can expand it by
jump table, bit test or array access.

You can expand this example with:
--param case-values-threshold=4

Reply via email to