PR target/69175
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 12 Jan 2016 13:19:49 +0000 (13:19 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 12 Jan 2016 13:19:49 +0000 (13:19 +0000)
* ifcvt.c (cond_exec_process_if_block): When removing the last
insn from then_bb, remove also any possible barriers that follow it.

* g++.dg/opt/pr69175.C: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@232267 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/ifcvt.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/opt/pr69175.C [new file with mode: 0644]

index c7674e5..5ae37fc 100644 (file)
@@ -1,3 +1,9 @@
+2016-01-12  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/69175
+       * ifcvt.c (cond_exec_process_if_block): When removing the last
+       insn from then_bb, remove also any possible barriers that follow it.
+
 2016-01-12  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR target/68456
index 7d94e75..ec6c3de 100644 (file)
@@ -740,7 +740,7 @@ cond_exec_process_if_block (ce_if_block * ce_info,
       rtx_insn *from = then_first_tail;
       if (!INSN_P (from))
        from = find_active_insn_after (then_bb, from);
-      delete_insn_chain (from, BB_END (then_bb), false);
+      delete_insn_chain (from, get_last_bb_insn (then_bb), false);
     }
   if (else_last_head)
     delete_insn_chain (first_active_insn (else_bb), else_last_head, false);
index 5fb7ba0..3ac0457 100644 (file)
@@ -1,3 +1,8 @@
+2016-01-12  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/69175
+       * g++.dg/opt/pr69175.C: New test.
+
 2016-01-12  Alan Lawrence  <alan.lawrence@arm.com>
 
        * gcc.dg/vect/fast-math-bb-slp-call-3.c: Declare functions as 'extern'
diff --git a/gcc/testsuite/g++.dg/opt/pr69175.C b/gcc/testsuite/g++.dg/opt/pr69175.C
new file mode 100644 (file)
index 0000000..e24f681
--- /dev/null
@@ -0,0 +1,29 @@
+// PR target/69175
+// { dg-do compile }
+// { dg-options "-O2" }
+// { dg-additional-options "-march=armv7-a -mfloat-abi=hard -mfpu=vfpv3-d16 -mthumb" { target { arm_hard_vfp_ok && arm_thumb2_ok } } }
+
+struct A { A *c, *d; } a;
+struct B { A *e; A *f; void foo (); };
+void *b;
+
+void
+B::foo ()
+{
+  if (b) 
+    {
+      A *n = (A *) b;
+      if (b == e)
+       if (n == f)
+         e = __null;
+       else
+         e->c = __null;
+      else
+       n->d->c = &a;
+      n->d = e;
+      if (e == __null)
+       e = f = n;
+      else
+       e = n;
+    }
+}