diff mbox

Fix -fdump-ipa-all ICE

Message ID 750978e8-b157-be2f-f1b0-1c9483fc9d81@suse.cz
State New
Headers show

Commit Message

Martin Liška April 24, 2017, 12:03 p.m. UTC
On 04/24/2017 12:51 PM, Jakub Jelinek wrote:
> No testcase in the patch?

As Honza is busy right not, I'm sending one.

Martin

Comments

Jan Hubicka April 24, 2017, 12:12 p.m. UTC | #1
> On 04/24/2017 12:51 PM, Jakub Jelinek wrote:
> > No testcase in the patch?
> 
> As Honza is busy right not, I'm sending one.
Thanks (in fact I just forgot to include it and was about to send it now) but
help is welcome!

Honza
> 
> Martin

> >From 87cef5e3123723f81c44dfafe86fa10b7925cea8 Mon Sep 17 00:00:00 2001
> From: marxin <mliska@suse.cz>
> Date: Mon, 24 Apr 2017 14:02:54 +0200
> Subject: [PATCH] Add new test-case.
> 
> gcc/testsuite/ChangeLog:
> 
> 2017-04-24  Martin Liska  <mliska@suse.cz>
> 
> 	* g++.dg/ipa/pr79931.C: New test.
> ---
>  gcc/testsuite/g++.dg/ipa/pr79931.C | 24 ++++++++++++++++++++++++
>  1 file changed, 24 insertions(+)
>  create mode 100644 gcc/testsuite/g++.dg/ipa/pr79931.C
> 
> diff --git a/gcc/testsuite/g++.dg/ipa/pr79931.C b/gcc/testsuite/g++.dg/ipa/pr79931.C
> new file mode 100644
> index 00000000000..78f6e03c458
> --- /dev/null
> +++ b/gcc/testsuite/g++.dg/ipa/pr79931.C
> @@ -0,0 +1,24 @@
> +/* { dg-do compile } */
> +/* { dg-options "-O2 -fdump-ipa-all" } */
> +
> +class DocumentImpl;
> +struct NodeImpl
> +{
> +  virtual DocumentImpl * getOwnerDocument();
> +  virtual NodeImpl * getParentNode();
> +  virtual NodeImpl * removeChild(NodeImpl *oldChild);
> +};
> +struct AttrImpl : NodeImpl
> +{
> +  NodeImpl *insertBefore(NodeImpl *newChild, NodeImpl *refChild);
> +};
> +struct DocumentImpl : NodeImpl
> +{
> +  virtual NodeImpl *removeChild(NodeImpl *oldChild);
> +  virtual int* getRanges();
> +};
> +NodeImpl *AttrImpl::insertBefore(NodeImpl *newChild, NodeImpl *refChild) {
> +  NodeImpl *oldparent = newChild->getParentNode();
> +  oldparent->removeChild(newChild);
> +  this->getOwnerDocument()->getRanges();
> +}
> -- 
> 2.12.2
>
Jakub Jelinek April 24, 2017, 12:31 p.m. UTC | #2
On Mon, Apr 24, 2017 at 02:12:31PM +0200, Jan Hubicka wrote:
> > On 04/24/2017 12:51 PM, Jakub Jelinek wrote:
> > > No testcase in the patch?
> > 
> > As Honza is busy right not, I'm sending one.
> Thanks (in fact I just forgot to include it and was about to send it now) but
> help is welcome!

Ok for release branches.

	Jakub
diff mbox

Patch

From 87cef5e3123723f81c44dfafe86fa10b7925cea8 Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Mon, 24 Apr 2017 14:02:54 +0200
Subject: [PATCH] Add new test-case.

gcc/testsuite/ChangeLog:

2017-04-24  Martin Liska  <mliska@suse.cz>

	* g++.dg/ipa/pr79931.C: New test.
---
 gcc/testsuite/g++.dg/ipa/pr79931.C | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 gcc/testsuite/g++.dg/ipa/pr79931.C

diff --git a/gcc/testsuite/g++.dg/ipa/pr79931.C b/gcc/testsuite/g++.dg/ipa/pr79931.C
new file mode 100644
index 00000000000..78f6e03c458
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ipa/pr79931.C
@@ -0,0 +1,24 @@ 
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-ipa-all" } */
+
+class DocumentImpl;
+struct NodeImpl
+{
+  virtual DocumentImpl * getOwnerDocument();
+  virtual NodeImpl * getParentNode();
+  virtual NodeImpl * removeChild(NodeImpl *oldChild);
+};
+struct AttrImpl : NodeImpl
+{
+  NodeImpl *insertBefore(NodeImpl *newChild, NodeImpl *refChild);
+};
+struct DocumentImpl : NodeImpl
+{
+  virtual NodeImpl *removeChild(NodeImpl *oldChild);
+  virtual int* getRanges();
+};
+NodeImpl *AttrImpl::insertBefore(NodeImpl *newChild, NodeImpl *refChild) {
+  NodeImpl *oldparent = newChild->getParentNode();
+  oldparent->removeChild(newChild);
+  this->getOwnerDocument()->getRanges();
+}
-- 
2.12.2