From: Jakub Jelinek Date: Mon, 12 Dec 2016 22:02:52 +0000 (+0100) Subject: re PR tree-optimization/78777 (ICE in mark_reachable_handlers, at tree-eh.c:3823... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1697df8c99b5b5d0252c7c26113f16f0d0c87c1b;p=gcc.git re PR tree-optimization/78777 (ICE in mark_reachable_handlers, at tree-eh.c:3823 (aarch64-linux-gnu)) 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. * g++.dg/torture/pr78777.C: New test. From-SVN: r243584 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 50a9cf75376..95e896637ad 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,9 @@ 2016-12-12 Jakub Jelinek + 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. diff --git a/gcc/gimple-ssa-strength-reduction.c b/gcc/gimple-ssa-strength-reduction.c index 21dcbb05056..ba82a200449 100644 --- a/gcc/gimple-ssa-strength-reduction.c +++ b/gcc/gimple-ssa-strength-reduction.c @@ -2253,7 +2253,7 @@ create_add_on_incoming_edge (slsr_cand_t c, tree basis_name, 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) @@ -3243,7 +3243,7 @@ insert_initializers (slsr_cand_t c) 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) { diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 71a6e2a53dd..b4eea7231f3 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-12-12 Jakub Jelinek + + PR tree-optimization/78777 + * g++.dg/torture/pr78777.C: New test. + 2016-12-12 Martin Sebor PR middle-end/78622 diff --git a/gcc/testsuite/g++.dg/torture/pr78777.C b/gcc/testsuite/g++.dg/torture/pr78777.C new file mode 100644 index 00000000000..451289e5949 --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr78777.C @@ -0,0 +1,29 @@ +// 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); + } + } +}