aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>2019-08-23 11:41:32 +0000
committermarxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>2019-08-23 11:41:32 +0000
commit9a2d4402352e0847c9d2be2a8afedd52a9224a52 (patch)
tree726a235230db374d48beb370e65e0d1323d8353c
parentfbafbdd5b01f1eb62a8d7b3bd43f4089bef5d4f2 (diff)
Backport r274503
2019-08-23 Martin Liska <mliska@suse.cz> Backport from mainline 2019-08-15 Martin Liska <mliska@suse.cz> * cgraph.c (cgraph_node::verify_node): Verify origin, nested and next_nested. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-9-branch@274852 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/cgraph.c24
2 files changed, 32 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index fc42afe4079..9d3214e0292 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -3,6 +3,14 @@
Backport from mainline
2019-08-15 Martin Liska <mliska@suse.cz>
+ * cgraph.c (cgraph_node::verify_node): Verify origin, nested
+ and next_nested.
+
+2019-08-23 Martin Liska <mliska@suse.cz>
+
+ Backport from mainline
+ 2019-08-15 Martin Liska <mliska@suse.cz>
+
PR ipa/91404
* passes.c (order): Remove.
(uid_hash_t): Likewise).
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index db4c9c747b9..d9e7353bd7b 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -3449,6 +3449,30 @@ cgraph_node::verify_node (void)
e->aux = 0;
}
}
+
+ if (nested != NULL)
+ {
+ for (cgraph_node *n = nested; n != NULL; n = n->next_nested)
+ {
+ if (n->origin == NULL)
+ {
+ error ("missing origin for a node in a nested list");
+ error_found = true;
+ }
+ else if (n->origin != this)
+ {
+ error ("origin points to a different parent");
+ error_found = true;
+ break;
+ }
+ }
+ }
+ if (next_nested != NULL && origin == NULL)
+ {
+ error ("missing origin for a node in a nested list");
+ error_found = true;
+ }
+
if (error_found)
{
dump (stderr);