re PR tree-optimization/85712 (ICE in all_phi_incrs_profitable_1 at gcc/gimple-ssa...
authorBill Schmidt <wschmidt@linux.ibm.com>
Fri, 25 May 2018 19:12:16 +0000 (19:12 +0000)
committerWilliam Schmidt <wschmidt@gcc.gnu.org>
Fri, 25 May 2018 19:12:16 +0000 (19:12 +0000)
2018-05-25  Bill Schmidt  <wschmidt@linux.ibm.com>

PR tree-optimization/85712
* gimple-ssa-strength-reduction.c (replace_one_candidate): Skip if
this candidate has already been replaced in-situ by a copy.

From-SVN: r260772

gcc/ChangeLog
gcc/gimple-ssa-strength-reduction.c

index a1ef11e..aef4d9a 100644 (file)
@@ -1,3 +1,9 @@
+2018-05-25  Bill Schmidt  <wschmidt@linux.ibm.com>
+
+       PR tree-optimization/85712
+       * gimple-ssa-strength-reduction.c (replace_one_candidate): Skip if
+       this candidate has already been replaced in-situ by a copy.
+
 2018-05-25  Jason Merrill  <jason@redhat.com>
 
         PR c++/80485 - inline function non-zero address.
index a4e5a52..b86ce85 100644 (file)
@@ -3662,6 +3662,11 @@ replace_one_candidate (slsr_cand_t c, unsigned i, tree basis_name)
   orig_rhs2 = gimple_assign_rhs2 (c->cand_stmt);
   cand_incr = cand_increment (c);
 
+  /* If orig_rhs2 is NULL, we have already replaced this in situ with
+     a copy statement under another interpretation.  */
+  if (!orig_rhs2)
+    return;
+
   if (dump_file && (dump_flags & TDF_DETAILS))
     {
       fputs ("Replacing: ", dump_file);