diff options
author | Kito Cheng <kito.cheng@sifive.com> | 2025-08-14 17:30:17 +0800 |
---|---|---|
committer | Kito Cheng <kito.cheng@sifive.com> | 2025-08-15 14:35:32 +0800 |
commit | 5b60bb6dc70e7f94f9c9a8d7584981ecf0720641 (patch) | |
tree | fb3abd176e6e5de716d7f0a3c5999a27fc090202 | |
parent | d1c207a65d25b50e851ab53956271c91e0281ae0 (diff) | |
download | gcc-5b60bb6dc70e7f94f9c9a8d7584981ecf0720641.zip gcc-5b60bb6dc70e7f94f9c9a8d7584981ecf0720641.tar.gz gcc-5b60bb6dc70e7f94f9c9a8d7584981ecf0720641.tar.bz2 |
Use gimple_call_fntype rather than gimple_call_fndecl in pass_return_slot::execute
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.
-rw-r--r-- | gcc/tree-nrv.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/tree-nrv.cc b/gcc/tree-nrv.cc index 3be97af..9b514b7 100644 --- a/gcc/tree-nrv.cc +++ b/gcc/tree-nrv.cc @@ -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. */ |