Re: [patch] Cleanup tree-switch-conversion a bit

2012-04-19 Thread Steven Bosscher
On Thu, Apr 19, 2012 at 4:55 PM, H.J. Lu wrote: > On Tue, Apr 17, 2012 at 9:15 AM, Steven Bosscher > wrote: >>> My goal for GCC 4.8 is to do just that: Move switch expansion to >>> GIMPLE and add value profiling for switch expressions. >> >> And the idea is to put all that code in tree-switch-co

Re: [patch] Cleanup tree-switch-conversion a bit

2012-04-19 Thread H.J. Lu
On Tue, Apr 17, 2012 at 9:15 AM, Steven Bosscher wrote: >> My goal for GCC 4.8 is to do just that: Move switch expansion to >> GIMPLE and add value profiling for switch expressions. > > And the idea is to put all that code in tree-switch-conversion.c. But > there are a few clean-ups I wish to do o

Re: [patch] Cleanup tree-switch-conversion a bit

2012-04-18 Thread Steven Bosscher
On Wed, Apr 18, 2012 at 8:30 PM, Steven Bosscher wrote: > The Go bits approved on IRC by Iant, the Fortran bits are obvious, and > the rest was already approved. This is r186579 now. And because I managed to commit from the wrong tree, the fixed commit is r186580. Index: gimplify.c =

Re: [patch] Cleanup tree-switch-conversion a bit

2012-04-18 Thread Steven Bosscher
On Wed, Apr 18, 2012 at 5:17 PM, Steven Bosscher wrote: > On Wed, Apr 18, 2012 at 1:23 PM, Richard Guenther wrote: >> I suppose generic tree handling routines are confused by NULL TREE_TYPE >> and thus changing the docs to void_type_node would be more appropriate. > > I don't agree with that. The

Re: [patch] Cleanup tree-switch-conversion a bit

2012-04-18 Thread Steven Bosscher
On Wed, Apr 18, 2012 at 1:23 PM, Richard Guenther wrote: > I suppose generic tree handling routines are confused by NULL TREE_TYPE > and thus changing the docs to void_type_node would be more appropriate. I don't agree with that. The documented behavior is much older than either the Fortran or th

Re: [patch] Cleanup tree-switch-conversion a bit

2012-04-18 Thread Richard Guenther
On Wed, 18 Apr 2012, Steven Bosscher wrote: > On Wed, Apr 18, 2012 at 11:10 AM, Richard Guenther wrote: > > I wonder about > > > > @@ -1575,6 +1575,9 @@ gimplify_switch_expr (tree *expr_p, gimple_seq *pr > >   tree switch_expr = *expr_p; > >   gimple_seq switch_body_seq = NULL; > >   enum gimplif

Re: [patch] Cleanup tree-switch-conversion a bit

2012-04-18 Thread Steven Bosscher
On Wed, Apr 18, 2012 at 11:10 AM, Richard Guenther wrote: > I wonder about > > @@ -1575,6 +1575,9 @@ gimplify_switch_expr (tree *expr_p, gimple_seq *pr >   tree switch_expr = *expr_p; >   gimple_seq switch_body_seq = NULL; >   enum gimplify_status ret; > +  tree index_type = TREE_TYPE (switch_expr

Re: [patch] Cleanup tree-switch-conversion a bit

2012-04-18 Thread Richard Guenther
On Wed, 18 Apr 2012, Steven Bosscher wrote: > Hello, > > This is another step towards moving GIMPLE_SWITCH expansion to an > earlier point in the pipeline. > > With the attached patch, some of the logic from stmt.c:add_case_node() > is moved to gimplify.c:gimplify_switch_expr(). This includes: >

Re: [patch] Cleanup tree-switch-conversion a bit

2012-04-18 Thread Richard Guenther
On Tue, Apr 17, 2012 at 6:15 PM, Steven Bosscher wrote: >> My goal for GCC 4.8 is to do just that: Move switch expansion to >> GIMPLE and add value profiling for switch expressions. > > And the idea is to put all that code in tree-switch-conversion.c. But > there are a few clean-ups I wish to do o

[patch] Cleanup tree-switch-conversion a bit

2012-04-17 Thread Steven Bosscher
Hello, This is another step towards moving GIMPLE_SWITCH expansion to an earlier point in the pipeline. With the attached patch, some of the logic from stmt.c:add_case_node() is moved to gimplify.c:gimplify_switch_expr(). This includes: * Code to drop case labels that are out of range for the sw

[patch] Cleanup tree-switch-conversion a bit

2012-04-17 Thread Steven Bosscher
> My goal for GCC 4.8 is to do just that: Move switch expansion to > GIMPLE and add value profiling for switch expressions. And the idea is to put all that code in tree-switch-conversion.c. But there are a few clean-ups I wish to do on that code before that. First, there is a global pass info stru