On Sun, Jul 1, 2012 at 11:58 AM, Richard Guenther <richard.guent...@gmail.com> wrote: > On Sat, Jun 30, 2012 at 12:29 PM, Steven Bosscher <stevenb....@gmail.com> > wrote: >> Hello, >> >> This patch moves the emit_case_bit_tests method of switch lowering >> from 'expand' to a GIMPLE pass. >> >> Initially, I planned to move all switch lowering to something other >> than a casesi or tablejump to GIMPLE, but this is more involved than I >> anticipated. My plan was (and still is, but for later) to do the >> switch lowering using a divide-and-conquer approach: Parts of a switch >> may be best expanded as bit-tests, other parts maybe as a decision >> tree, and yet others as casesi/tablejump (the code in stmt.c uses only >> one of these approaches per GIMPLE_SWITCH). Also I wanted to use >> profile information in the lowering decision making (using Freescale's >> patch as a basis). But I need to come up with a way to handle the SJLJ >> dispatch table issue. >> >> I'll continue to work on all of the above, and I hope I can finish >> everything I planned to work on for GCC 4.8. >> But to make sure I don't miss the GCC 4.8 stage1 deadline, I'm >> proposing this for trunk now. >> >> Bootstrapped&tested on powerpc64-unknown-linux-gnu - several times in >> fact, over the past few months. >> Bootstrapped&tested on x86_64-unknown-linux-gnu. Also built&tested on >> various powerpc64 X embedded targets. >> >> OK for trunk? > > This is ok.
Hello, It turns out that I had a code generation bug in the transformation all along, but it only triggered since the straight-line strength reduction pass was introduced. This also showed up in a switchconv test case that should have failed, but passed. So I fixed the test case also, in this new patch. Fixed patch attached, which I tested in the same way as before. I'll commit this later this week, assuming your approval still stands. Ciao! Steven
move_switch_as_case_bit_tests_to_GIMPLE_v2.diff
Description: Binary data