aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2018-01-05 09:51:32 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2018-01-05 09:51:32 +0100
commitbef52a6895ddb01d4b349f2f43b8ab0cd99fa3be (patch)
treedd78b3fcb7149b6b1f01919954805387f20f2265 /gcc
parent64b371b1b5a681e58c22c6decb1884e0811d6014 (diff)
downloadgcc-bef52a6895ddb01d4b349f2f43b8ab0cd99fa3be.zip
gcc-bef52a6895ddb01d4b349f2f43b8ab0cd99fa3be.tar.gz
gcc-bef52a6895ddb01d4b349f2f43b8ab0cd99fa3be.tar.bz2
re PR tree-optimization/83605 (ICE: verify_gimple failed (error: dead STMT in EH table))
PR tree-optimization/83605 * gimple-ssa-strength-reduction.c: Include tree-eh.h. (find_candidates_dom_walker::before_dom_children): Ignore stmts that can throw. * gcc.dg/pr83605.c: New test. From-SVN: r256274
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/gimple-ssa-strength-reduction.c4
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/pr83605.c20
4 files changed, 36 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 1fcf203..14cd939 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2018-01-05 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/83605
+ * gimple-ssa-strength-reduction.c: Include tree-eh.h.
+ (find_candidates_dom_walker::before_dom_children): Ignore stmts that
+ can throw.
+
2018-01-05 Sebastian Huber <sebastian.huber@embedded-brains.de>
* config.gcc (epiphany-*-elf*): Add (epiphany-*-rtems*) configuration.
diff --git a/gcc/gimple-ssa-strength-reduction.c b/gcc/gimple-ssa-strength-reduction.c
index 521d7e9..1c00f09 100644
--- a/gcc/gimple-ssa-strength-reduction.c
+++ b/gcc/gimple-ssa-strength-reduction.c
@@ -55,6 +55,7 @@ along with GCC; see the file COPYING3. If not see
#include "params.h"
#include "tree-ssa-address.h"
#include "tree-affine.h"
+#include "tree-eh.h"
#include "builtins.h"
/* Information about a strength reduction candidate. Each statement
@@ -1747,6 +1748,9 @@ find_candidates_dom_walker::before_dom_children (basic_block bb)
{
gimple *gs = gsi_stmt (gsi);
+ if (stmt_could_throw_p (gs))
+ continue;
+
if (gimple_vuse (gs) && gimple_assign_single_p (gs))
slsr_process_ref (gs);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 90f4d57..990cefa 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2018-01-05 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/83605
+ * gcc.dg/pr83605.c: New test.
+
2018-01-04 Jakub Jelinek <jakub@redhat.com>
PR target/83554
diff --git a/gcc/testsuite/gcc.dg/pr83605.c b/gcc/testsuite/gcc.dg/pr83605.c
new file mode 100644
index 0000000..c680f0c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr83605.c
@@ -0,0 +1,20 @@
+/* PR tree-optimization/83605 */
+/* { dg-do compile } */
+/* { dg-options "-O1 -ftrapv -fexceptions -fnon-call-exceptions" } */
+
+int a;
+
+int
+foo (int x)
+{
+ int b = a;
+ {
+ int c;
+ int *d = (x == 0) ? &c : &b;
+
+ for (a = 0; a < 2; ++a)
+ c = (x + b) < a;
+
+ return *d;
+ }
+}