diff options
Diffstat (limited to 'gcc/tree-nrv.c')
-rw-r--r-- | gcc/tree-nrv.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/tree-nrv.c b/gcc/tree-nrv.c index 78b6c0e2c25..953135b0375 100644 --- a/gcc/tree-nrv.c +++ b/gcc/tree-nrv.c @@ -28,6 +28,7 @@ along with GCC; see the file COPYING3. If not see #include "tree-pretty-print.h" #include "gimple-iterator.h" #include "gimple-walk.h" +#include "internal-fn.h" /* This file implements return value optimizations for functions which return aggregate types. @@ -377,6 +378,12 @@ pass_return_slot::execute (function *fun) if (stmt && gimple_call_lhs (stmt) && !gimple_call_return_slot_opt_p (stmt) + /* Ignore internal functions without direct optabs, + those are expanded specially and aggregate_value_p + on their result might result in undesirable warnings + with some backends. */ + && (!gimple_call_internal_p (stmt) + || direct_internal_fn_p (gimple_call_internal_fn (stmt))) && aggregate_value_p (TREE_TYPE (gimple_call_lhs (stmt)), gimple_call_fndecl (stmt))) { |