re PR rtl-optimization/68730 (wrong code at -O3 on x86_64-linux-gnu (in 32-bit mode))
authorJakub Jelinek <jakub@redhat.com>
Mon, 14 Dec 2015 08:04:37 +0000 (09:04 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 14 Dec 2015 08:04:37 +0000 (09:04 +0100)
PR rtl-optimization/68730
* cfgrtl.c (cfg_layout_finalize): Free dominators.

* gcc.dg/pr68730.c: New test.

From-SVN: r231606

gcc/ChangeLog
gcc/cfgrtl.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr68730.c [new file with mode: 0644]

index 42955284bc35728b56d7a193fdc90cf2434d603a..e6a2763e6e87cccbd01da5c73c54dc7794a927ed 100644 (file)
@@ -1,3 +1,8 @@
+2015-12-14  Jakub Jelinek  <jakub@redhat.com>
+
+       PR rtl-optimization/68730
+       * cfgrtl.c (cfg_layout_finalize): Free dominators.
+
 2015-12-13  Alexandre Oliva <aoliva@redhat.com>
 
        PR debug/67355
index b8cfd5c5b89c080af126b1135ace54551d54e626..fbfc7cd67902032be762f1a86b8474a8b2a1c6a9 100644 (file)
@@ -4299,6 +4299,7 @@ void
 cfg_layout_finalize (void)
 {
   checking_verify_flow_info ();
+  free_dominance_info (CDI_DOMINATORS);
   force_one_exit_fallthru ();
   rtl_register_cfg_hooks ();
   if (reload_completed && !targetm.have_epilogue ())
index 199507482797f1a69748c275ad4ef6facbb21b69..2b900bfabac3f38d24095674375407ffd3150c76 100644 (file)
@@ -1,3 +1,8 @@
+2015-12-14  Jakub Jelinek  <jakub@redhat.com>
+
+       PR rtl-optimization/68730
+       * gcc.dg/pr68730.c: New test.
+
 2015-12-14  Thomas Preud'homme  <thomas.preudhomme@arm.com>
 
        PR testsuite/68629
diff --git a/gcc/testsuite/gcc.dg/pr68730.c b/gcc/testsuite/gcc.dg/pr68730.c
new file mode 100644 (file)
index 0000000..8ec6f19
--- /dev/null
@@ -0,0 +1,51 @@
+/* PR rtl-optimization/68730 */
+/* { dg-do compile } */
+/* { dg-options "-O3 -fno-if-conversion" } */
+/* { dg-additional-options "-march=x86-64" { target { i?86-*-* x86_64-*-* } } } */
+
+int b, d, e;
+unsigned long long c = 4100543410106915;
+
+void
+foo (void)
+{
+  short f, g = 4 % c;
+  int h = c;
+  if (h)
+    {
+      int i = ~c;
+      if (~c)
+       i = 25662;
+      f = g = i;
+      h = c - g + ~-f;
+      c = ~(c * h - f);
+    }
+  f = g;
+  unsigned long long k = g || c;
+  short l = c ^ g ^ k;
+  if (g > 25662 || c == 74074520320 || !(g < 2))
+    {
+      k = c;
+      l = g;
+      c = ~((k && c) + ~l);
+      f = ~(f * (c ^ k) | l);
+      if (c > k)
+       __builtin_printf ("%d\n", f);
+    }
+  short m = -f;
+  unsigned long long n = c;
+  c = m * f | n % c;
+  if (n)
+    __builtin_printf ("%d\n", f);
+  while (f < -31807)
+    ;
+  c = ~(n | c) | f;
+  if (n < c)
+    __builtin_printf ("%lld\n", (long long) f);
+  for (; d;)
+    for (; e;)
+      for (;;)
+       ;
+  c = h;
+  c = l % c;
+}