On Thu, May 19, 2016 at 10:04 AM, Martin Liška <mli...@suse.cz> wrote:
> Hello.
>
> Following patch fixes the ICE as it defensively finds the right
> place where a new STMT should be inserted.
>
> Patch bootstraps on x86_64-linux-gnu and no new regression is introduced.
>
> Ready for trunk?

@@ -3813,7 +3813,8 @@ rewrite_expr_tree (gimple *stmt, unsigned int opindex,
             some redundant operations, so unless we are just swapping the
             arguments or unless there is no change at all (then we just
             return lhs), force creation of a new SSA_NAME.  */
-         if (changed || ((rhs1 != oe2->op || rhs2 != oe1->op) && opindex))
+         if (changed || ((rhs1 != oe2->op || rhs2 != oe1->op) && opindex)
+             || find_insert_point (stmt, oe1->op, oe2->op) != stmt)
            {
              gimple *insert_point
                = find_insert_point (stmt, oe1->op, oe2->op);
@@ -3830,8 +3831,6 @@ rewrite_expr_tree (gimple *stmt, unsigned int opindex,
            }
          else
            {
-             gcc_checking_assert (find_insert_point (stmt, oe1->op, oe2->op)
-                                  == stmt);
              gimple_assign_set_rhs1 (stmt, oe1->op);
              gimple_assign_set_rhs2 (stmt, oe2->op);
              update_stmt (stmt);

please CSE the find_insert_point call(s).  The whole code looks somewhat odd
as an insert point of 'stmt' seems to mean we can replace it?!

That said, you might paper over an issue elsewhere here...

That said, I absolutely hate this "insert-point" stuff in reassoc.
Please somebody
sit down and write a simple "scheduler" on GIMPLE and remove all this code from
reassoc.

Richard.

> Thanks,
> Martin

Reply via email to