This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] [PR 81245] Fix tree-if-conv calling of update_stmt after fold_stmt
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Andrew Pinski <pinskia at gmail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 30 Jun 2017 10:20:55 +0200
- Subject: Re: [PATCH] [PR 81245] Fix tree-if-conv calling of update_stmt after fold_stmt
- Authentication-results: sourceware.org; auth=none
- References: <CA+=Sn1nEo5FF4zAYD_ojNuDJ9v2Qh=RAw-XQ0B9W=F8S8EpKxg@mail.gmail.com>
On Thu, Jun 29, 2017 at 10:12 PM, Andrew Pinski <firstname.lastname@example.org> wrote:
> As described in the bug, tree-if-conv is calling update_stmt on an
> old stmt which might have been removed from the IR already
> (transforming of an assignment to a call in this case). This fixes
> the problem by calling update_stmt on the new statement that fold_stmt
> might have created.
> OK? Bootstrapped and tested on aarch64-linux-gnu with no regressions.
update_stmt is not necessary when fold_stmt doesn't return true as
gsi_insert_before already updates the stmt.
Thus ok with moving update_stmt under the conditional.
> Andrew Pinski
> * tree-if-conv.c (predicate_scalar_phi): Update new_stmt if fold_stmt
> returned true.
> * gcc.dg/torture/pr81245.c: New testcase.