2016-12-12 Jakub Jelinek <jakub@redhat.com>
+ PR tree-optimization/78777
+ * gimple-ssa-strength-reduction.c (create_add_on_incoming_edge,
+ insert_initializers): Use stmt_ends_bb_p instead of is_ctrl_stmt.
+
PR other/78766
* opt-functions.awk (opt_args): Use [{] instead of { in regexps.
Formatting fix.
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)))
+ if (!gsi_end_p (gsi) && stmt_ends_bb_p (gsi_stmt (gsi)))
{
gsi_insert_before (&gsi, new_stmt, GSI_SAME_STMT);
if (cast_stmt)
gimple *basis_stmt = lookup_cand (c->basis)->cand_stmt;
location_t loc = gimple_location (basis_stmt);
- if (!gsi_end_p (gsi) && is_ctrl_stmt (gsi_stmt (gsi)))
+ if (!gsi_end_p (gsi) && stmt_ends_bb_p (gsi_stmt (gsi)))
{
if (cast_stmt)
{
+2016-12-12 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/78777
+ * g++.dg/torture/pr78777.C: New test.
+
2016-12-12 Martin Sebor <msebor@redhat.com>
PR middle-end/78622
--- /dev/null
+// PR tree-optimization/78777
+
+void bar (char);
+struct C { char b; };
+struct H { char d[5]; int e; C *f[4]; int g[10]; };
+void baz (C *, unsigned char *, int);
+unsigned char j[10];
+
+void
+foo (H *o, int p, unsigned char *q, int r, char n, H *b)
+{
+ for (int m = 0; m < o->e; m++)
+ {
+ if (o->f[m] || o->g[m])
+ continue;
+ try
+ {
+ baz (o->f[m], j, 5);
+ if (p)
+ baz (o->f[m], q, r);
+ }
+ catch (int)
+ {
+ C a = *o->f[m];
+ if (b)
+ bar (n & a.b);
+ }
+ }
+}