diff options
author | Jakub Jelinek <jakub@redhat.com> | 2017-04-05 07:25:18 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2017-04-05 07:25:18 +0200 |
commit | 36f896c7728d0d0f39cea1f064a809c2e684db45 (patch) | |
tree | e33a8dee4a33fe4fdf2bf3811fa6c87ed9b76b78 /gcc/tree-nrv.c | |
parent | 451522116c1dffcd12e86b03eec9eeb3bda2ee1c (diff) | |
download | gcc-36f896c7728d0d0f39cea1f064a809c2e684db45.zip gcc-36f896c7728d0d0f39cea1f064a809c2e684db45.tar.gz gcc-36f896c7728d0d0f39cea1f064a809c2e684db45.tar.bz2 |
re PR target/80310 (Bogus -Wpsabi warning with -fsanitize=signed-integer-overflow)
PR target/80310
* tree-nvr.c: Include internal-fn.h.
(pass_return_slot::execute): Ignore internal calls without
direct optab.
* c-c++-common/ubsan/pr80310.c: New test.
From-SVN: r246699
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 78b6c0e..953135b 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))) { |