[Bug middle-end/40748] simple switch/case, if/else and arithmetics result in different code

2017-06-18 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=40748 --- Comment #3 from Marc Glisse --- 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:

[Bug middle-end/40748] simple switch/case, if/else and arithmetics result in different code

2009-07-15 Thread rguenth at gcc dot gnu dot org
--- Comment #2 from rguenth at gcc dot gnu dot org 2009-07-15 09:34 --- switch-conversion could try to handle this. Generally perfect hashing during switch expansion is another thing. -- rguenth at gcc dot gnu dot org changed: What|Removed |Added