* c-typeck.c (c_process_expr_stmt): Skip over nops and
call mark_exp_read even if exprv is ADDR_EXPR.
* c-c++-common/Wunused-var-14.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@178110
138bc75d-0d04-0410-961f-
82ee72b054a4
+2011-08-26 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/50179
+ * c-typeck.c (c_process_expr_stmt): Skip over nops and
+ call mark_exp_read even if exprv is ADDR_EXPR.
+
2011-08-26 Richard Sandiford <richard.sandiford@linaro.org>
* df-problems.c (df_note_bb_compute): Pass uses rather than defs
exprv = expr;
while (TREE_CODE (exprv) == COMPOUND_EXPR)
exprv = TREE_OPERAND (exprv, 1);
- if (DECL_P (exprv) || handled_component_p (exprv))
+ while (CONVERT_EXPR_P (exprv))
+ exprv = TREE_OPERAND (exprv, 0);
+ if (DECL_P (exprv)
+ || handled_component_p (exprv)
+ || TREE_CODE (exprv) == ADDR_EXPR)
mark_exp_read (exprv);
/* If the expression is not of a type to which we cannot assign a line
+2011-08-26 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/50179
+ * c-c++-common/Wunused-var-14.c: New test.
+
2011-08-26 Tom de Vries <tom@codesourcery.com>
* gcc.dg/tree-ssa/ivopts-lt.c: New test.
--- /dev/null
+/* PR c/50179 */
+/* { dg-options "-Wunused" } */
+/* { dg-do compile } */
+
+void bar (int, ...);
+
+char *
+foo (void)
+{
+ bar (1, (__extension__ ({ static char b[2]; b[0] = 1; b; })));
+ bar (1, ({ static char c[2]; c[0] = 1; c; }));
+ return ({ static char d[2]; d[0] = 1; d; });
+}