This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PR71252][PR71269] Fix trunk errors due to stmt_to_insert
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Kugan Vivekanandarajah <kugan dot vivekanandarajah at linaro dot org>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Richard Biener <richard dot guenther at gmail dot com>
- Date: Thu, 26 May 2016 10:18:43 +0200
- Subject: Re: [PR71252][PR71269] Fix trunk errors due to stmt_to_insert
- Authentication-results: sourceware.org; auth=none
- References: <CAELXzTO6r_Tu0kMcfzk73XB5C-qGKWPsOVDeiy3iA47h30Sn7A at mail dot gmail dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Thu, May 26, 2016 at 02:17:56PM +1000, Kugan Vivekanandarajah wrote:
> --- a/gcc/tree-ssa-reassoc.c
> +++ b/gcc/tree-ssa-reassoc.c
> @@ -3767,8 +3767,10 @@ swap_ops_for_binary_stmt (vec<operand_entry *> ops,
> operand_entry temp = *oe3;
> oe3->op = oe1->op;
> oe3->rank = oe1->rank;
> + oe3->stmt_to_insert = oe1->stmt_to_insert;
> oe1->op = temp.op;
> oe1->rank= temp.rank;
> + oe1->stmt_to_insert = temp.stmt_to_insert;
If you want to swap those 3 fields (what about the others?), can't you write
std::swap (oe1->op, oe3->op);
std::swap (oe1->rank, oe3->rank);
std::swap (oe1->stmt_to_insert, oe3->stmt_to_insert);
instead and drop operand_entry temp = *oe3; ?
> }
> else if ((oe1->rank == oe3->rank
> && oe2->rank != oe3->rank)
> @@ -3779,8 +3781,10 @@ swap_ops_for_binary_stmt (vec<operand_entry *> ops,
> operand_entry temp = *oe2;
> oe2->op = oe1->op;
> oe2->rank = oe1->rank;
> + oe2->stmt_to_insert = oe1->stmt_to_insert;
> oe1->op = temp.op;
> oe1->rank = temp.rank;
> + oe1->stmt_to_insert = temp.stmt_to_insert;
> }
Similarly.
Jakub