diff options
author | Jakub Jelinek <jakub@redhat.com> | 2018-03-09 23:23:14 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2018-03-09 23:23:14 +0100 |
commit | 2956d3a8ddf9b1c676ab54b1a081a007f5081b8e (patch) | |
tree | 4ae4bf3c6ce9de041908d06861f612eccc5d20dd | |
parent | 1577f10a637352b4fe7fb4a4c0fd672a96c84f58 (diff) | |
download | gcc-2956d3a8ddf9b1c676ab54b1a081a007f5081b8e.zip gcc-2956d3a8ddf9b1c676ab54b1a081a007f5081b8e.tar.gz gcc-2956d3a8ddf9b1c676ab54b1a081a007f5081b8e.tar.bz2 |
re PR target/84772 (powerpc-spe: Spurious "is used uninitialized" warning, or possibly incorrect codegen for va_arg(long double))
PR target/84772
* config/rs6000/rs6000.c (rs6000_gimplify_va_arg): Mark va_arg_tmp
temporary TREE_ADDRESSABLE before gimplification of BUILT_IN_MEMCPY.
* config/powerpcspe/powerpcspe.c (rs6000_gimplify_va_arg): Likewise.
* gcc.dg/pr84772.c: New test.
From-SVN: r258399
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/config/powerpcspe/powerpcspe.c | 1 | ||||
-rw-r--r-- | gcc/config/rs6000/rs6000.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr84772.c | 13 |
5 files changed, 23 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7d7ece8..e0e8e98 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2018-03-09 Jakub Jelinek <jakub@redhat.com> + PR target/84772 + * config/rs6000/rs6000.c (rs6000_gimplify_va_arg): Mark va_arg_tmp + temporary TREE_ADDRESSABLE before gimplification of BUILT_IN_MEMCPY. + * config/powerpcspe/powerpcspe.c (rs6000_gimplify_va_arg): Likewise. + PR c++/84767 * tree-inline.c (copy_tree_body_r): For INDIRECT_REF of a remapped decl, use remap_type if we want to use the type. diff --git a/gcc/config/powerpcspe/powerpcspe.c b/gcc/config/powerpcspe/powerpcspe.c index fa8c8cc..b500cd3 100644 --- a/gcc/config/powerpcspe/powerpcspe.c +++ b/gcc/config/powerpcspe/powerpcspe.c @@ -14254,6 +14254,7 @@ rs6000_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p, tree copy = build_call_expr (builtin_decl_implicit (BUILT_IN_MEMCPY), 3, dest_addr, addr, size_int (rsize * 4)); + TREE_ADDRESSABLE (tmp) = 1; gimplify_and_add (copy, pre_p); addr = dest_addr; diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 63f62d4..cdb1918 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -13537,6 +13537,7 @@ rs6000_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p, tree copy = build_call_expr (builtin_decl_implicit (BUILT_IN_MEMCPY), 3, dest_addr, addr, size_int (rsize * 4)); + TREE_ADDRESSABLE (tmp) = 1; gimplify_and_add (copy, pre_p); addr = dest_addr; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a8ef381..cac6560 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2018-03-09 Jakub Jelinek <jakub@redhat.com> + PR target/84772 + * gcc.dg/pr84772.c: New test. + PR c++/84076 * g++.dg/warn/Wformat-2.C: New test. diff --git a/gcc/testsuite/gcc.dg/pr84772.c b/gcc/testsuite/gcc.dg/pr84772.c new file mode 100644 index 0000000..1241d21 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr84772.c @@ -0,0 +1,13 @@ +/* PR target/84772 */ +/* { dg-do compile } */ +/* { dg-options "-O -Wuninitialized" } */ + +#include <stdarg.h> + +void +foo (int *x, int y, va_list ap) +{ + __builtin_memset (x, 0, sizeof (int)); + for (int i = 0; i < y; i++) + va_arg (ap, long double); /* { dg-bogus "uninitialized" } */ +} |