This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR62081
- From: Sebastian Pop <sebpop at gmail dot com>
- To: Richard Biener <rguenther at suse dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 14 Aug 2014 17:14:24 +0000
- 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>
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;
> + 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;
> }