Call free_dominance_info when transformed in DCE (PR rtl-optimization/89242).
authorMartin Liska <mliska@suse.cz>
Thu, 14 Feb 2019 11:30:58 +0000 (12:30 +0100)
committerMartin Liska <marxin@gcc.gnu.org>
Thu, 14 Feb 2019 11:30:58 +0000 (11:30 +0000)
2019-02-14  Martin Liska  <mliska@suse.cz>

PR rtl-optimization/89242
* dce.c (delete_unmarked_insns): Call free_dominance_info we
process a transformation.
2019-02-14  Martin Liska  <mliska@suse.cz>

PR rtl-optimization/89242
* g++.dg/pr89242.C: New test.

From-SVN: r268873

gcc/ChangeLog
gcc/dce.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/pr89242.C [new file with mode: 0644]

index c800ee18da31e7301c3619dded93d5d95cda8b0f..fd554df1471d533e6cb24bcfd7d87417441df2fe 100644 (file)
@@ -1,3 +1,9 @@
+2019-02-14  Martin Liska  <mliska@suse.cz>
+
+       PR rtl-optimization/89242
+       * dce.c (delete_unmarked_insns): Call free_dominance_info we
+       process a transformation.
+
 2019-02-14  Jakub Jelinek  <jakub@redhat.com>
 
        PR tree-optimization/89314
index cb18e81592a381d2b96b2162f0c8ddf4f4175545..8fb109c7388666db78dde3d07c9a1a1b4c991d10 100644 (file)
--- a/gcc/dce.c
+++ b/gcc/dce.c
@@ -652,6 +652,7 @@ delete_unmarked_insns (void)
     {
       gcc_assert (can_alter_cfg);
       delete_unreachable_blocks ();
+      free_dominance_info (CDI_DOMINATORS);
     }
 }
 
index 7c2b71bb0108db90fbddc8917abb696d8e53591b..def998a14ee74e09342d3b0a3a03b0b2bf770760 100644 (file)
@@ -1,3 +1,8 @@
+2019-02-14  Martin Liska  <mliska@suse.cz>
+
+       PR rtl-optimization/89242
+       * g++.dg/pr89242.C: New test.
+
 2019-02-14  Jakub Jelinek  <jakub@redhat.com>
 
        PR tree-optimization/89314
diff --git a/gcc/testsuite/g++.dg/pr89242.C b/gcc/testsuite/g++.dg/pr89242.C
new file mode 100644 (file)
index 0000000..a702fef
--- /dev/null
@@ -0,0 +1,15 @@
+// { dg-do compile }
+// { dg-options "-fno-rerun-cse-after-loop -ftrapv -fno-tree-loop-optimize -fdelete-dead-exceptions -fno-forward-propagate -fnon-call-exceptions -O2" }
+
+void bar (int n, char *p)
+{
+  try
+    {
+      n++;
+      for (int i = 0; i < n - 1; i++)
+       p[i];
+    }
+  catch (...)
+    {}
+}
+