Re: nested switch optimization

2011-06-30 Thread Richard Guenther
On Wed, Jun 29, 2011 at 9:14 PM, Ian Lance Taylor wrote: > "Marcin J." writes: > >> will be possible to add optimization that merge this two (or more) switch in >> one big one (even if inner one is from inline function?) and then use one >> jump table for both switches? > > Is it possible?  Sur

Re: nested switch optimization

2011-06-29 Thread Ian Lance Taylor
"Marcin J." writes: > will be possible to add optimization that merge this two (or more) switch in > one big one (even if inner one is from inline function?) and then use one > jump table for both switches? Is it possible? Sure. It's quite a special case, though, so if it's enabled by defaul

nested switch optimization

2011-06-29 Thread Marcin J.
Hello i have code: void a(int i) { switch(i) { default: switch(i) // exactly that same i { case 0: f0(); break; case 1: f1(); break; case 2: f2(); break;