aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr87468.c15
-rw-r--r--gcc/tree-ssa-threadupdate.c12
4 files changed, 37 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b0b85ba..f9a12f8 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2018-11-23 Jeff Law <law@redhat.com>
+
+ PR rtl-optimization/87468
+ * tree-ssa-threadupdate.c (create_block_for_threading): Clear
+ EDGE_IGNORE on all outgoing edges of the duplicate block.
+
2018-11-23 Vladimir Makarov <vmakarov@redhat.com>
PR bootstrap/88157
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index e31d40d..587526e7 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2018-11-23 Jeff Law <law@redhat.com>
+
+ PR rtl-optimization/84768
+ * gcc.c-torture/compile/pr84768.c: New test.
+
2018-11-23 Vladimir Makarov <vmakarov@redhat.com>
* gcc.target/powerpc/pr70669.c: Use unary minus instead of
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr87468.c b/gcc/testsuite/gcc.c-torture/compile/pr87468.c
new file mode 100644
index 0000000..2f5cf80
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr87468.c
@@ -0,0 +1,15 @@
+a;
+b() {
+ int c = 1;
+ for (; c <= 3;) {
+ int d = e() && !0;
+ switch (c)
+ case 1:
+ if (d)
+ case 2:
+ case 3:
+ f();
+ if (a)
+ c++;
+ }
+}
diff --git a/gcc/tree-ssa-threadupdate.c b/gcc/tree-ssa-threadupdate.c
index 6630516..e7c7ca6 100644
--- a/gcc/tree-ssa-threadupdate.c
+++ b/gcc/tree-ssa-threadupdate.c
@@ -336,7 +336,17 @@ create_block_for_threading (basic_block bb,
rd->dup_blocks[count] = duplicate_block (bb, NULL, NULL);
FOR_EACH_EDGE (e, ei, rd->dup_blocks[count]->succs)
- e->aux = NULL;
+ {
+ e->aux = NULL;
+
+ /* If we duplicate a block with an outgoing edge marked as
+ EDGE_IGNORE, we must clear EDGE_IGNORE so that it doesn't
+ leak out of the current pass.
+
+ It would be better to simplify switch statements and remove
+ the edges before we get here, but the sequencing is nontrivial. */
+ e->flags &= ~EDGE_IGNORE;
+ }
/* Zero out the profile, since the block is unreachable for now. */
rd->dup_blocks[count]->count = profile_count::uninitialized ();