This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR62081
- From: Richard Biener <rguenther at suse dot de>
- To: Sebastian Pop <sebpop at gmail dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 15 Aug 2014 09:43:37 +0200 (CEST)
- Subject: Re: [PATCH] Fix PR62081
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot LSU dot 2 dot 11 dot 1408141348430 dot 20733 at zhemvz dot fhfr dot qr> <20140814171424 dot GA25884 at instance-1 dot c dot bardezibar dot internal>
On Thu, 14 Aug 2014, Sebastian Pop wrote:
> Richard Biener wrote:
> >
> > The following fixes missing dominator computation before fixing loops.
> > Rather than doing even more such weird stuff in a pass gate function
> > this puts this into a new pass scheduled before the loop passes gate.
> >
>
> Ok.
>
> > +unsigned int
> > +pass_fix_loops::execute (function *)
> > +{
>
> I would add an early exit if there are no loops in the function
> (like in the original code below...)
>
> if (!loops_for_fn (fn))
> return 0;
Note that's not how things work today - loops_for_fn () returns
non-NULL even for zero-loop functions as soon as we have CFG.
The "hack" below was for -fdump-passes which calls each gate
of every pass before the CFG is set up and thus would crash
gate_loop if we didn't do that check. Of course -fdump-passes
reports sth that is not true for all functions here.
Richard.
> > + if (loops_state_satisfies_p (LOOPS_NEED_FIXUP))
> > + {
> > + calculate_dominance_info (CDI_DOMINATORS);
> > + fix_loop_structure (NULL);
> > + }
> > + return 0;
> > +}
>
> [...]
>
> > /* Gate for loop pass group. The group is controlled by -ftree-loop-optimize
> > but we also avoid running it when the IL doesn't contain any loop. */
> >
> > @@ -57,9 +107,6 @@ gate_loop (function *fn)
> > if (!loops_for_fn (fn))
> > return true;
>
> ... here.
>
> >
> > - /* Make sure to drop / re-discover loops when necessary. */
> > - if (loops_state_satisfies_p (LOOPS_NEED_FIXUP))
> > - fix_loop_structure (NULL);
> > return number_of_loops (fn) > 1;
> > }
>