aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2018-01-18 16:57:48 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2018-01-18 15:57:48 +0000
commit8b2d991b0390c1bae18b0af416b841f360184e22 (patch)
treef1a5bfbdb2c85fd876a4e72f9deea404e93a5e4e
parent1f0267acfd4cc3d2582b41c7470e81fec9972a83 (diff)
downloadgcc-8b2d991b0390c1bae18b0af416b841f360184e22.zip
gcc-8b2d991b0390c1bae18b0af416b841f360184e22.tar.gz
gcc-8b2d991b0390c1bae18b0af416b841f360184e22.tar.bz2
re PR ipa/83619 (ICE in inliner: caller edge count does not match BB count)
PR ipa/83619 * g++.dg/torture/pr83619.C: New testcase. * cgraph.c (cgraph_edge::redirect_call_stmt_to_callee): Update edge frequencies. From-SVN: r256850
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/cgraph.c2
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/torture/pr83619.C67
4 files changed, 80 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 19116fb..fcbd840 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2018-01-18 Jan Hubicka <hubicka@ucw.cz>
+
+ PR ipa/83619
+ * cgraph.c (cgraph_edge::redirect_call_stmt_to_callee): Update edge
+ frequencies.
+
2018-01-18 Boris Kolpackov <boris@codesynthesis.com>
PR other/70268
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index 802214d..9a7d54d 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -1327,6 +1327,7 @@ cgraph_edge::redirect_call_stmt_to_callee (void)
e->speculative = false;
e->caller->set_call_stmt_including_clones (e->call_stmt, new_stmt,
false);
+ e->count = gimple_bb (e->call_stmt)->count;
/* Fix edges for BUILT_IN_CHKP_BNDRET calls attached to the
processed call stmt. */
@@ -1346,6 +1347,7 @@ cgraph_edge::redirect_call_stmt_to_callee (void)
}
e2->speculative = false;
+ e2->count = gimple_bb (e2->call_stmt)->count;
ref->speculative = false;
ref->stmt = NULL;
/* Indirect edges are not both in the call site hash.
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index faf1799..c45345f 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2018-01-18 Jan Hubicka <hubicka@ucw.cz>
+
+ PR ipa/83619
+ * g++.dg/torture/pr83619.C: New testcase.
+
2018-01-18 Christophe Lyon <christophe.lyon@linaro.org>
* lib/target-supports.exp (check_effective_target_arm_arch_FUNC_ok):
diff --git a/gcc/testsuite/g++.dg/torture/pr83619.C b/gcc/testsuite/g++.dg/torture/pr83619.C
new file mode 100644
index 0000000..a5ca537
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/pr83619.C
@@ -0,0 +1,67 @@
+// { dg-do compile }
+int a;
+class d
+{
+public:
+ virtual unsigned c ();
+};
+class e;
+class i
+{
+ void h ();
+
+public:
+ void
+ operator= (e *f)
+ {
+ j<int>::c (f);
+ h ();
+ }
+ template <class> struct j
+ {
+ static void
+ c (e *g)
+ {
+ g->c ();
+ }
+ };
+};
+class k;
+class l
+{
+public:
+ l (int);
+ k *operator-> ();
+};
+class e : public d
+{
+};
+class m final : e
+{
+ unsigned c ();
+};
+class k
+{
+public:
+ virtual int o (e *) = 0;
+};
+class H : d, k
+{
+ int o (e *);
+ i n;
+};
+unsigned
+m::c ()
+{
+ l b = 0;
+ b->o (this);
+ return a;
+}
+int
+H::o (e *p)
+{
+ n = p;
+ return a;
+}
+
+