mirror of git://gcc.gnu.org/git/gcc.git
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
This commit is contained in:
parent
42cd874911
commit
9243c51d5f
|
@ -1,5 +1,9 @@
|
||||||
2012-03-13 Jakub Jelinek <jakub@redhat.com>
|
2012-03-13 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
|
PR c/52577
|
||||||
|
* c-parser.c (c_parser_postfix_expression)
|
||||||
|
<case RID_BUILTIN_SHUFFLE>: Call mark_exp_read on argument values.
|
||||||
|
|
||||||
* config/i386/smmintrin.h: Avoid /* within a comment.
|
* config/i386/smmintrin.h: Avoid /* within a comment.
|
||||||
* config/i386/nmmintrin.h: Likewise.
|
* config/i386/nmmintrin.h: Likewise.
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/* Parser for C and Objective-C.
|
/* Parser for C and Objective-C.
|
||||||
Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
|
Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
|
||||||
1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011
|
1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011,
|
||||||
Free Software Foundation, Inc.
|
2012 Free Software Foundation, Inc.
|
||||||
|
|
||||||
Parser actions based on the old Bison parser; structure somewhat
|
Parser actions based on the old Bison parser; structure somewhat
|
||||||
influenced by and fragments based on the C++ parser.
|
influenced by and fragments based on the C++ parser.
|
||||||
|
@ -6647,6 +6647,8 @@ c_parser_postfix_expression (c_parser *parser)
|
||||||
case RID_BUILTIN_SHUFFLE:
|
case RID_BUILTIN_SHUFFLE:
|
||||||
{
|
{
|
||||||
VEC(c_expr_t,gc) *cexpr_list;
|
VEC(c_expr_t,gc) *cexpr_list;
|
||||||
|
unsigned int i;
|
||||||
|
c_expr_t *p;
|
||||||
|
|
||||||
c_parser_consume_token (parser);
|
c_parser_consume_token (parser);
|
||||||
if (!c_parser_get_builtin_args (parser,
|
if (!c_parser_get_builtin_args (parser,
|
||||||
|
@ -6657,6 +6659,9 @@ c_parser_postfix_expression (c_parser *parser)
|
||||||
break;
|
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)
|
if (VEC_length (c_expr_t, cexpr_list) == 2)
|
||||||
expr.value =
|
expr.value =
|
||||||
c_build_vec_perm_expr
|
c_build_vec_perm_expr
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
2012-03-13 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
|
PR c/52577
|
||||||
|
* gcc.dg/Wunused-var-3.c: New test.
|
||||||
|
|
||||||
2012-03-13 Martin Jambor <mjambor@suse.cz>
|
2012-03-13 Martin Jambor <mjambor@suse.cz>
|
||||||
|
|
||||||
* gcc.dg/misaligned-expand-2.c: New test.
|
* gcc.dg/misaligned-expand-2.c: New test.
|
||||||
|
|
|
@ -0,0 +1,34 @@
|
||||||
|
/* PR c/52577 */
|
||||||
|
/* { dg-do compile } */
|
||||||
|
/* { dg-options "-Wunused" } */
|
||||||
|
|
||||||
|
typedef int V __attribute__((vector_size (sizeof (int) * 4)));
|
||||||
|
|
||||||
|
void
|
||||||
|
f1 (V *p)
|
||||||
|
{
|
||||||
|
V mask = { 1, 2, 3, 0 };
|
||||||
|
*p = __builtin_shuffle (*p, mask);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
f2 (V *p, V *q)
|
||||||
|
{
|
||||||
|
V mask = { 1, 2, 3, 0 };
|
||||||
|
*p = __builtin_shuffle (*p, *q, mask);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
f3 (V *p, V *mask)
|
||||||
|
{
|
||||||
|
V a = { 1, 2, 3, 0 };
|
||||||
|
*p = __builtin_shuffle (a, *mask);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
f4 (V *p, V *mask)
|
||||||
|
{
|
||||||
|
V a = { 1, 2, 3, 0 };
|
||||||
|
V b = { 2, 3, 4, 1 };
|
||||||
|
*p = __builtin_shuffle (a, b, *mask);
|
||||||
|
}
|
Loading…
Reference in New Issue