Re: [Patch] Silent gcc 4.2.0 loop optimization bug with -O2

From: Andrey Chernov <ache_at_nagual.pp.ru>
Date: Wed, 4 Jul 2007 23:01:48 +0400
On Wed, Jul 04, 2007 at 02:12:08PM +0200, Ed Schouten wrote:
> > Index: tree-ssa-loop-niter.c
> > ===================================================================
> > --- tree-ssa-loop-niter.c       (revision 126260)
> > +++ tree-ssa-loop-niter.c       (working copy)
> > _at__at_ -1747,6 +1747,12 _at__at_ infer_loop_bounds_from_undefined (struct
> >      {
> >        bb = bbs[i];
> > 
> > +      /* If BB is not executed in each iteration of the loop, we cannot
> > +        use the operations in it to infer reliable upper bound on the
> > +        # of iterations of the loop.  */
> > +      if (!dominated_by_p (CDI_DOMINATORS, loop->latch, bb))
> > +       continue;
> > +
> >        for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
> >          {
> >           tree stmt = bsi_stmt (bsi);
> > 
> > I'm going to test this.
> > 
> ----- End forwarded message -----
> 
> I just tested the patch on my desktop and it seems to work. The test
> code now compiles like it should. Hopefully it will be part of 4.2.1.

Will be nice if this patch will be commited in instead of my 
sys.mk workaround. Alexander?

-- 
http://ache.pp.ru/

Received on Wed Jul 04 2007 - 17:01:52 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:13 UTC