+2017-08-16 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
+
+ Backport from mainline
+ 2017-08-08 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
+
+ PR tree-optimization/81354
+ * gimple-ssa-strength-reduction.c (create_add_on_incoming_edge):
+ Insert on edges rather than explicitly creating landing pads.
+ (analyze_candidates_and_replace): Commit edge inserts.
+
2017-07-31 Jakub Jelinek <jakub@redhat.com>
PR sanitizer/81604
widest_int increment, edge e, location_t loc,
bool known_stride)
{
- basic_block insert_bb;
- gimple_stmt_iterator gsi;
tree lhs, basis_type;
gassign *new_stmt;
gcc_unreachable ();
}
- insert_bb = single_succ_p (e->src) ? e->src : split_edge (e);
- gsi = gsi_last_bb (insert_bb);
-
- if (!gsi_end_p (gsi) && is_ctrl_stmt (gsi_stmt (gsi)))
- gsi_insert_before (&gsi, new_stmt, GSI_NEW_STMT);
- else
- gsi_insert_after (&gsi, new_stmt, GSI_NEW_STMT);
-
gimple_set_location (new_stmt, loc);
+ gsi_insert_on_edge (e, new_stmt);
if (dump_file && (dump_flags & TDF_DETAILS))
{
- fprintf (dump_file, "Inserting in block %d: ", insert_bb->index);
+ fprintf (dump_file, "Inserting on edge %d->%d: ", e->src->index,
+ e->dest->index);
print_gimple_stmt (dump_file, new_stmt, 0, 0);
}
free (incr_vec);
}
}
+
+ /* For conditional candidates, we may have uncommitted insertions
+ on edges to clean up. */
+ gsi_commit_edge_inserts ();
}
namespace {
+2017-08-16 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
+
+ Backport from mainline
+ 2017-08-08 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
+
+ PR tree-optimization/81354
+ * g++.dg/torture/pr81354.C: New file.
+
2017-07-31 Jakub Jelinek <jakub@redhat.com>
PR sanitizer/81604
--- /dev/null
+// PR81354 reported this test as crashing in a limited range of revisions.
+// { dg-do compile }
+
+struct T { double a; double b; };
+
+void foo(T Ad[], int As[2])
+{
+ int j;
+ int i;
+ int Bs[2] = {0,0};
+ T Bd[16];
+
+ for (j = 0; j < 4; j++) {
+ for (i = 0; i + 1 <= j + 1; i++) {
+ Ad[i + As[0] * j] = Bd[i + Bs[0] * j];
+ }
+
+ i = j + 1; // <- comment out this line and it does not crash
+ for (; i + 1 < 5; i++) {
+ Ad[i + As[0] * j].a = 0.0;
+ Ad[i + As[0] * j].b = 0.0;
+ }
+ }
+}