diff options
author | Jakub Jelinek <jakub@redhat.com> | 2012-03-13 22:19:50 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2012-03-13 22:19:50 +0100 |
commit | 9243c51d5fa12be42dede398b3c7a812fc95519c (patch) | |
tree | 2a4d87591c71e6a130ccb9f1c26a71d33562e62a /gcc/c-parser.c | |
parent | 42cd8749119567c40d4fd93747e30ee72e6f836c (diff) | |
download | gcc-9243c51d5fa12be42dede398b3c7a812fc95519c.zip gcc-9243c51d5fa12be42dede398b3c7a812fc95519c.tar.gz gcc-9243c51d5fa12be42dede398b3c7a812fc95519c.tar.bz2 |
re PR c/52577 (__builtin_shuffle -Wunused-but-set-* false positives)
PR c/52577
* c-parser.c (c_parser_postfix_expression)
<case RID_BUILTIN_SHUFFLE>: Call mark_exp_read on argument values.
* gcc.dg/Wunused-var-3.c: New test.
From-SVN: r185355
Diffstat (limited to 'gcc/c-parser.c')
-rw-r--r-- | gcc/c-parser.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/c-parser.c b/gcc/c-parser.c index 867ab41..56134c2 100644 --- a/gcc/c-parser.c +++ b/gcc/c-parser.c @@ -1,7 +1,7 @@ /* Parser for C and Objective-C. Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011 - Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011, + 2012 Free Software Foundation, Inc. Parser actions based on the old Bison parser; structure somewhat influenced by and fragments based on the C++ parser. @@ -6647,6 +6647,8 @@ c_parser_postfix_expression (c_parser *parser) case RID_BUILTIN_SHUFFLE: { VEC(c_expr_t,gc) *cexpr_list; + unsigned int i; + c_expr_t *p; c_parser_consume_token (parser); if (!c_parser_get_builtin_args (parser, @@ -6657,6 +6659,9 @@ c_parser_postfix_expression (c_parser *parser) break; } + FOR_EACH_VEC_ELT (c_expr_t, cexpr_list, i, p) + mark_exp_read (p->value); + if (VEC_length (c_expr_t, cexpr_list) == 2) expr.value = c_build_vec_perm_expr |