This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/81744] [8 Regression] ICE: verify_ssa failed, at tree-ssa.c:1186
- From: "amker at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 07 Aug 2017 10:32:21 +0000
- Subject: [Bug tree-optimization/81744] [8 Regression] ICE: verify_ssa failed, at tree-ssa.c:1186
- Auto-submitted: auto-generated
- References: <bug-81744-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81744
--- Comment #6 from amker at gcc dot gnu.org ---
(In reply to Jakub Jelinek from comment #5)
> (In reply to amker from comment #4)
> > So with below code in prepare_finalizers_chain:
> > tree fini, niters = number_of_latch_executions (loop);
> > //...
> > niters = copy_node (niters);
> > niters = force_gimple_operand (niters, &stmts, true, NULL);
> >
> > Even with copy_node, the old niters (which is loop->nb_iterations is changed
> > by the call to force_gimple_operand. The code expects every time function
> > prepare_finalizers_chain is callsed, the niters/loop->nb_iterations stays in
> > the same. What should I do that? Thanks.
>
> copy_node copies only one level. force_gimple_operand, like other
> entrypoints to the gimplifier, are destructive on the tree you pass in, so
> if you want to reuse niters after it, you should use niters = unshare_expr
> (niters).
Yes, I will send a patch. Thanks.