Callback edges without a carrying edge weren't permitted, but that
changed with internal callback edges. This patch changes the code
checking that a carrying edge exists to account for this.
gcc/ChangeLog:
* cgraph.cc (cgraph_node::verify_node): Exclude internal
callbacks from carrying edge checks.
Signed-off-by: Josef Melcr <[email protected]>
---
gcc/cgraph.cc | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/gcc/cgraph.cc b/gcc/cgraph.cc
index fc1d7838d5d..6dab18cf298 100644
--- a/gcc/cgraph.cc
+++ b/gcc/cgraph.cc
@@ -4437,13 +4437,14 @@ cgraph_node::verify_node (void)
if (e->callback)
{
- if (!e->get_callback_carrying_edge ())
- {
- error ("callback edge %s->%s has no callback-carrying",
- identifier_to_locale (e->caller->name ()),
- identifier_to_locale (e->callee->name ()));
- error_found = true;
- }
+ if (!e->get_callback_carrying_edge ()
+ && (!e->call_stmt || !gimple_call_internal_p (e->call_stmt)))
+ {
+ error ("callback edge %s->%s has no callback-carrying edge",
+ identifier_to_locale (e->caller->dump_name ()),
+ identifier_to_locale (e->callee->dump_name ()));
+ error_found = true;
+ }
}
if (e->has_callback
--
2.55.0