]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Backport r274503
authorMartin Liska <mliska@suse.cz>
Fri, 23 Aug 2019 11:41:32 +0000 (13:41 +0200)
committerMartin Liska <marxin@gcc.gnu.org>
Fri, 23 Aug 2019 11:41:32 +0000 (11:41 +0000)
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.

From-SVN: r274852

gcc/ChangeLog
gcc/cgraph.c

index fc42afe4079fdb7e9f5ac64be6358a5be6ac3ec8..9d3214e02927a1ff55264fa03a0e0887e75b5672 100644 (file)
@@ -1,3 +1,11 @@
+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.
+
 2019-08-23  Martin Liska  <mliska@suse.cz>
 
        Backport from mainline
index db4c9c747b9ed871f00397f5acd907400718e214..d9e7353bd7bf9fa5a4db1846562e86f399f7fcaa 100644 (file)
@@ -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);