Message ID | 20180309222902.GI8577@tucnak |
---|---|
State | New |
Headers | show |
Series | [committed] Fix va_arg gimplification on powerpc{,spe} (PR target/84772) | expand |
Hi, On Fri, Mar 09, 2018 at 11:29:02PM +0100, Jakub Jelinek wrote: > The following is a powerpcspe variant of the sparc PR39645, and rs6000 > has the same code (not sure if ever used or dead after powerpcspe removal). It's not dead, this code is for the SVR4 ABI, used on most 32-bit targets (including powerpc-linux). Thanks for the patch, Segher
--- gcc/config/rs6000/rs6000.c.jj 2018-03-07 22:52:01.294479625 +0100 +++ gcc/config/rs6000/rs6000.c 2018-03-09 17:29:09.811949947 +0100 @@ -13537,6 +13537,7 @@ rs6000_gimplify_va_arg (tree valist, tre 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; --- gcc/config/powerpcspe/powerpcspe.c.jj 2018-01-03 10:20:14.842537106 +0100 +++ gcc/config/powerpcspe/powerpcspe.c 2018-03-09 17:29:35.291959951 +0100 @@ -14254,6 +14254,7 @@ rs6000_gimplify_va_arg (tree valist, tre 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; --- gcc/testsuite/gcc.dg/pr84772.c.jj 2018-03-09 17:34:56.732749975 +0100 +++ gcc/testsuite/gcc.dg/pr84772.c 2018-03-09 17:33:05.095042322 +0100 @@ -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" } */ +}