https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122225

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
I'm testing

diff --git a/gcc/tree-cfg.cc b/gcc/tree-cfg.cc
index 5b2919ae10f..01d92210938 100644
--- a/gcc/tree-cfg.cc
+++ b/gcc/tree-cfg.cc
@@ -4800,6 +4800,7 @@ verify_gimple_return (greturn *stmt)
 {
   tree op = gimple_return_retval (stmt);
   tree restype = TREE_TYPE (TREE_TYPE (cfun->decl));
+  tree resdecl = DECL_RESULT (cfun->decl);

   /* We cannot test for present return values as we do not fix up missing
      return values from the original source.  */
@@ -4814,12 +4815,7 @@ verify_gimple_return (greturn *stmt)
       return true;
     }

-  if ((TREE_CODE (op) == RESULT_DECL
-       && DECL_BY_REFERENCE (op))
-      || (TREE_CODE (op) == SSA_NAME
-         && SSA_NAME_VAR (op)
-         && TREE_CODE (SSA_NAME_VAR (op)) == RESULT_DECL
-         && DECL_BY_REFERENCE (SSA_NAME_VAR (op))))
+  if (resdecl && DECL_BY_REFERENCE (resdecl))
     op = TREE_TYPE (op);

   if (!useless_type_conversion_p (restype, TREE_TYPE (op)))

Reply via email to