aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorSegher Boessenkool <segher@kernel.crashing.org>2016-12-01 03:04:10 +0100
committerSegher Boessenkool <segher@gcc.gnu.org>2016-12-01 03:04:10 +0100
commit0f09127808018c479214478d3f79e0ac40a3c55b (patch)
treec69848023a1231979a3e106f46baf23fb8e7cbdb /gcc
parente95a3eb3c67bfb9a2d3e954e272545d033e8dd7f (diff)
downloadgcc-0f09127808018c479214478d3f79e0ac40a3c55b.zip
gcc-0f09127808018c479214478d3f79e0ac40a3c55b.tar.gz
gcc-0f09127808018c479214478d3f79e0ac40a3c55b.tar.bz2
combine: Emit a barrier after unconditional trap (PR78607)
After an unconditional trap there should be a barrier. In most cases one is automatically inserted, but not if the trap is the final insn in the instruction stream. We need to emit one explicitly. PR rtl-optimization/78607 * combine.c (try_combine): Emit a barrier after a unconditional trap. gcc/testsuite/ PR rtl-optimization/78607 * gcc.c-torture/compile/pr78607.c: New testcase. From-SVN: r243092
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/combine.c2
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr78607.c12
4 files changed, 24 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 7a46cd2..e2f7b25 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2016-12-01 Segher Boessenkool <segher@kernel.crashing.org>
+
+ PR rtl-optimization/78607
+ * combine.c (try_combine): Emit a barrier after a unconditional trap.
+
2016-11-30 Michael Meissner <meissner@linux.vnet.ibm.com>
PR target/78602
diff --git a/gcc/combine.c b/gcc/combine.c
index a8dae89..faafcb7 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -4627,6 +4627,7 @@ try_combine (rtx_insn *i3, rtx_insn *i2, rtx_insn *i1, rtx_insn *i0,
basic_block bb = BLOCK_FOR_INSN (i3);
gcc_assert (bb);
remove_edge (split_block (bb, i3));
+ emit_barrier_after_bb (bb);
*new_direct_jump_p = 1;
}
@@ -4637,6 +4638,7 @@ try_combine (rtx_insn *i3, rtx_insn *i2, rtx_insn *i1, rtx_insn *i0,
basic_block bb = BLOCK_FOR_INSN (undobuf.other_insn);
gcc_assert (bb);
remove_edge (split_block (bb, undobuf.other_insn));
+ emit_barrier_after_bb (bb);
*new_direct_jump_p = 1;
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index f38b586..bf4bd8a 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2016-12-01 Segher Boessenkool <segher@kernel.crashing.org>
+
+ PR rtl-optimization/78607
+ * gcc.c-torture/compile/pr78607.c: New testcase.
+
2016-11-30 Martin Sebor <msebor@redhat.com>
PR tree-optimization/78586
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr78607.c b/gcc/testsuite/gcc.c-torture/compile/pr78607.c
new file mode 100644
index 0000000..2c5420d
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr78607.c
@@ -0,0 +1,12 @@
+/* PR rtl-optimization/78607 */
+
+void
+rc (int cx)
+{
+ int mq;
+
+ if (mq == 0 && (cx / 0) != 0)
+ for (;;)
+ {
+ }
+}