]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Use gimple_call_fntype rather than gimple_call_fndecl in pass_return_slot::execute
authorKito Cheng <kito.cheng@sifive.com>
Thu, 14 Aug 2025 09:30:17 +0000 (17:30 +0800)
committerKito Cheng <kito.cheng@sifive.com>
Fri, 15 Aug 2025 06:35:32 +0000 (14:35 +0800)
Call with funciton pointer might not able to get the fndecl, but fntype
so use gimple_call_fntype instead of gimple_call_fndecl.

aggregate_value_p can handle fndecl and fntype right (and even CALL_EXPR), so I
think this change is safe.

gcc/ChangeLog:

* tree-nrv.cc (pass_return_slot::execute): Use
gimple_call_fntype instead of gimple_call_fndecl.

gcc/tree-nrv.cc

index 3be97afb319e6bf81c06f30f8699fc0c037d8f42..9b514b7e70b329b7ff4318a962b1ab87babe3b56 100644 (file)
@@ -385,7 +385,7 @@ pass_return_slot::execute (function *fun)
                 undesirable warnings with some backends.  */
              && !gimple_call_internal_p (stmt)
              && aggregate_value_p (TREE_TYPE (gimple_call_lhs (stmt)),
-                                   gimple_call_fndecl (stmt)))
+                                   gimple_call_fntype (stmt)))
            {
              /* Check if the location being assigned to is
                 clobbered by the call.  */