Fix PR rtl-optimization/34035

Steven Bosscher stevenb.gcc@gmail.com
Tue Nov 13 02:16:00 GMT 2007


On Nov 13, 2007 12:01 AM, Eric Botcazou <ebotcazou@libertysurf.fr> wrote:
> > With cleanup_cfg(0) you add another delete_trivially_dead_insns()
> > pass, and three iterations over all basic blocks.  This does seem, at
> > first, to be quite cheap.  The problem is that we do it all over the
> > place when it actually doesn't buy you anything: The "good" rtl passes
> > look through the dead code that d_t_d_i can remove, and even the
> > semi-good passes don't care about an extra forwarder block or a
> > single_succ block here and there.
>
> cleanup_cfg (0) is the canonical invocation to minimally clean up the CFG at
> the end of the RTL passes.  It is already run at the end of every CSE and
> GCSE pass if a single jump is modified.

True.  And whether that is a good thing?  I seriously doubt it.


> > IMO much of gcc's abysmal compile time performance can be blamed on
> > doing redundant work all over the place, trying hard for little gain.
> > Sorry to jump on your patch like this, but it just looks like
> > "obvious" redundant cfg cleanup work  (bikeshed, bikeshed! ;-)
>
> I don't think cleanup_cfg (0) is "trying hard"; otherwise tree optimization
> passes shouldn't be allowed to set TODO_cleanup_cfg.

Tree cleanup cfg takes about 3.5% of the total compile time for my
cc1-i files.  'nuff said.


> That being said, if you
> can come up with a testcase, I'll revise my position.

I think any random large function will show some compile time
increase, although obviously no compile time explosions.  As I said,
the problem is not so much to do it here, but that we do it
everywhere.  Anyway, ...


>  Of course don't try
> with C, C++ or Fortran, the change only affects those languages for which
> -fnon-call-exceptions is set, e.g. Ada that I specially care about.

...I had overlooked it only affects compilation with
-fnon-call-exceptions.  Not worth the battle :-)

Gr.
Steven



More information about the Gcc-patches mailing list