This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Teach VRP to derive ranges from SWITCH_EXPR (fix PR21258)


On Thu, 12 Apr 2007, Diego Novillo wrote:

> Richard Guenther wrote on 04/12/07 10:35:
> 
> > Bootstrapped and tested on x86_64-unknown-linux-gnu.  I will apply
> > this to mainline tomorrow.
> 
> Did you compare compile times vs optimization as I asked you on IRC?

There's a 1% slowdown for compiling tree.i with an unoptimized, checking
enabled stage1 compiler.
The patch will be on the C++ tester tonight to gather
more numbers.  GCC of course has lots of switch statements but also
benefits most from this optimization.

> > *************** vrp_visit_cond_stmt (tree stmt, edge *ta
> > *** 4759,4766 ****
> >   
> >     *taken_edge_p = NULL;
> >   
> > !   /* FIXME.  Handle SWITCH_EXPRs.  But first, the assert pass needs to
> > !      add ASSERT_EXPRs for them.  */
> >     if (TREE_CODE (stmt) == SWITCH_EXPR)
> >       return SSA_PROP_VARYING;
> >   
> > --- 4887,4893 ----
> >   
> >     *taken_edge_p = NULL;
> >   
> > !   /* FIXME.  Handle SWITCH_EXPRs.  */
> >     if (TREE_CODE (stmt) == SWITCH_EXPR)
> >       return SSA_PROP_VARYING;
> 
> Why not handle SWITCH_EXPR here?

I think that's an orthogonal problem -- will the propagator engine
be able to handle SWITCH_EXPR if I just touch this piece of VRP?

Richard.

-- 
Richard Guenther <rguenther@suse.de>
Novell / SUSE Labs
SUSE LINUX Products GmbH - Nuernberg - AG Nuernberg - HRB 16746 - GF: Markus Rex


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]