[Bug middle-end/70861] Improve code generation of switch tables

2016-04-28 Thread wdijkstr at arm dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70861 --- Comment #3 from Wilco --- (In reply to Andrew Pinski from comment #2) > Note I think if we had gotos instead of assignment here we should do the > similar thing for the switch table itself. Absolutely, that was my point. > Note also the ass

[Bug middle-end/70861] Improve code generation of switch tables

2016-04-28 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70861 --- Comment #2 from Andrew Pinski --- Note I think if we had gotos instead of assignment here we should do the similar thing for the switch table itself. Note also the assignment to i is getting in the way for the switch to constant table form.

[Bug middle-end/70861] Improve code generation of switch tables

2016-04-28 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70861 --- Comment #1 from Andrew Pinski --- I think we should turn this into the following: ((unsigned)a) <= 9 ? table[a] : (a == 110 ? 27 : 77); That is pull out the 110/default case so table would be small.