This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Free dominance info at the beginning of pass_jump_after_combine
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: Ilya Leoshkevich <iii at linux dot ibm dot com>
- Cc: gcc-patches at gcc dot gnu dot org, rguenther at suse dot de, law at redhat dot com, krebbel at linux dot ibm dot com
- Date: Tue, 12 Nov 2019 08:32:59 -0600
- Subject: Re: [PATCH] Free dominance info at the beginning of pass_jump_after_combine
- References: <20191112141105.36592-1-iii@linux.ibm.com>
Hi!
On Tue, Nov 12, 2019 at 03:11:05PM +0100, Ilya Leoshkevich wrote:
> try_forward_edges does not update dominance info, and merge_blocks
> relies on it being up-to-date. In PR92430 stale dominance info makes
> merge_blocks produce a loop in the dominator tree, which in turn makes
> delete_basic_block loop forever.
>
> Fix by freeing dominance info at the beginning of cleanup_cfg.
> --- a/gcc/cfgcleanup.c
> +++ b/gcc/cfgcleanup.c
> @@ -3312,6 +3312,9 @@ public:
> unsigned int
> pass_jump_after_combine::execute (function *)
> {
> + /* Jump threading does not keep dominators up-to-date. */
> + free_dominance_info (CDI_DOMINATORS);
> + free_dominance_info (CDI_POST_DOMINATORS);
> cleanup_cfg (flag_thread_jumps ? CLEANUP_THREADING : 0);
> return 0;
> }
Why do you always free it, if if only gets invalidated if flag_thread_jumps?
It may be a good idea to throw away the dom info anyway, but the comment
seems off then?
Segher