]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
2017-01-27 Bernd Schmidt <bschmidt@redhat.com>
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 27 Jan 2017 19:40:44 +0000 (19:40 +0000)
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 27 Jan 2017 19:40:44 +0000 (19:40 +0000)
PR rtl-optimization/79194
* cprop.c (one_cprop_pass): Move deletion of code after unconditional
traps before call to bypass_conditional_jumps.

PR rtl-optimization/79194
* gcc.dg/torture/pr79194.c: New test.

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

gcc/ChangeLog
gcc/cprop.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr79194.c [new file with mode: 0644]

index 4de9c0245bec920c4995df9d7d164decb5340608..39e6c1fb86d852cfede90d9051267dc15769eee9 100644 (file)
@@ -1,3 +1,9 @@
+2017-01-27  Bernd Schmidt  <bschmidt@redhat.com>
+
+       PR rtl-optimization/79194
+       * cprop.c (one_cprop_pass): Move deletion of code after unconditional
+       traps before call to bypass_conditional_jumps.
+
 2017-01-27  Vladimir Makarov  <vmakarov@redhat.com>
 
        PR tree-optimization/71374
index ae2f19d6f72bf9a3bc3437c1d2fe1a62bbfe65c0..f704a0d1f5ef26a4639bb79b398c0ba7cab397a5 100644 (file)
@@ -1863,8 +1863,6 @@ one_cprop_pass (void)
              }
        }
 
-      changed |= bypass_conditional_jumps ();
-
       while (!uncond_traps.is_empty ())
        {
          rtx_insn *insn = uncond_traps.pop ();
@@ -1873,6 +1871,8 @@ one_cprop_pass (void)
          emit_barrier_after_bb (to_split);
        }
 
+      changed |= bypass_conditional_jumps ();
+
       FREE_REG_SET (reg_set_bitmap);
       free_cprop_mem ();
     }
index f2d9dfb7274d1ec966539440c8cd593c9ada2c8e..eb63091bbdaf20cf67725c8f2a735e728ef06547 100644 (file)
@@ -1,3 +1,8 @@
+2017-01-27  Bernd Schmidt  <bschmidt@redhat.com>
+
+       PR rtl-optimization/79194
+       * gcc.dg/torture/pr79194.c: New test.
+
 2017-01-27  Vladimir Makarov  <vmakarov@redhat.com>
 
        PR tree-optimization/71374
diff --git a/gcc/testsuite/gcc.dg/torture/pr79194.c b/gcc/testsuite/gcc.dg/torture/pr79194.c
new file mode 100644 (file)
index 0000000..e7df690
--- /dev/null
@@ -0,0 +1,42 @@
+/* { dg-do compile } */
+
+int iw, vr;
+
+void
+d9 (unsigned int j3, long long int f5, int kp)
+{
+  int *qb = &kp;
+
+  if (kp != 0)
+    {
+      long long int oq;
+      unsigned int tl = 0;
+
+      for (j3 = 0; j3 < 1; ++j3)
+        qb = &tl;
+      goto ed;
+
+ l7:
+      oq = 1;
+      while (oq < 2)
+        oq *= j3;
+
+ ed:
+      do
+        {
+          oq -= *qb;
+          if (oq != 0)
+            {
+              long long int ie = j3 & f5;
+              int ws = (j3 != 0 && kp != 0);
+
+              tl = ie > ws;
+              iw = vr = tl;
+            }
+          else
+            tl = (kp != 0 && (0 % 0) != 0); /* { dg-warning "division by zero" } */
+        }
+      while (tl != 0);
+    }
+  goto l7;
+}