From 696c5b27c524cf65c6b06e93e62f047faad40a78 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Thu, 14 Feb 2019 12:30:58 +0100 Subject: [PATCH] Call free_dominance_info when transformed in DCE (PR rtl-optimization/89242). 2019-02-14 Martin Liska PR rtl-optimization/89242 * dce.c (delete_unmarked_insns): Call free_dominance_info we process a transformation. 2019-02-14 Martin Liska PR rtl-optimization/89242 * g++.dg/pr89242.C: New test. From-SVN: r268873 --- gcc/ChangeLog | 6 ++++++ gcc/dce.c | 1 + gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/pr89242.C | 15 +++++++++++++++ 4 files changed, 27 insertions(+) create mode 100644 gcc/testsuite/g++.dg/pr89242.C diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c800ee18da3..fd554df1471 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-02-14 Martin Liska + + PR rtl-optimization/89242 + * dce.c (delete_unmarked_insns): Call free_dominance_info we + process a transformation. + 2019-02-14 Jakub Jelinek PR tree-optimization/89314 diff --git a/gcc/dce.c b/gcc/dce.c index cb18e81592a..8fb109c7388 100644 --- 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); } } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 7c2b71bb010..def998a14ee 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-02-14 Martin Liska + + PR rtl-optimization/89242 + * g++.dg/pr89242.C: New test. + 2019-02-14 Jakub Jelinek PR tree-optimization/89314 diff --git a/gcc/testsuite/g++.dg/pr89242.C b/gcc/testsuite/g++.dg/pr89242.C new file mode 100644 index 00000000000..a702fef4f31 --- /dev/null +++ b/gcc/testsuite/g++.dg/pr89242.C @@ -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 (...) + {} +} + -- 2.30.2