Commit 557e8c49 by Jakub Jelinek Committed by Jakub Jelinek

re PR c/71719 (invalid set-but-not-used warning with vectors)

	PR c/71719
	* c-typeck.c (mark_exp_read): Handle VIEW_CONVERT_EXPR.

	* c-c++-common/Wunused-var-15.c: New test.

From-SVN: r237937
parent 547ef7de
2016-07-02 Jakub Jelinek <jakub@redhat.com>
PR c/71719
* c-typeck.c (mark_exp_read): Handle VIEW_CONVERT_EXPR.
2016-06-29 Thomas Schwinge <thomas@codesourcery.com>
* c-parser.c (c_parser_pragma) <PRAGMA_OMP_CANCELLATION_POINT>:
......
......@@ -1896,6 +1896,7 @@ mark_exp_read (tree exp)
case IMAGPART_EXPR:
CASE_CONVERT:
case ADDR_EXPR:
case VIEW_CONVERT_EXPR:
mark_exp_read (TREE_OPERAND (exp, 0));
break;
case COMPOUND_EXPR:
......
2016-07-02 Jakub Jelinek <jakub@redhat.com>
PR c/71719
* c-c++-common/Wunused-var-15.c: New test.
2016-07-01 Jakub Jelinek <jakub@redhat.com>
PR fortran/71687
......
/* PR c/71719 */
/* { dg-do compile } */
/* { dg-options "-Wunused -W -Wno-psabi" } */
typedef unsigned V __attribute__ ((vector_size (16)));
void bar (unsigned);
V x;
void
foo (V v) /* { dg-bogus "set but not used" } */
{
bar (v[0]);
V w = x; /* { dg-bogus "set but not used" } */
bar (w[1]);
}
/* Ignore a warning that is irrelevant to the purpose of this test. */
/* { dg-prune-output ".*GCC vector passed by reference.*" } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment