+2010-10-18 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/46015
+ * c-parser.c (c_parser_statement_after_labels): Call mark_exp_read
+ on computed goto argument.
+
2010-10-18 Richard Guenther <rguenther@suse.de>
PR tree-optimization/45967
}
else if (c_parser_next_token_is (parser, CPP_MULT))
{
+ tree val;
+
c_parser_consume_token (parser);
- stmt = c_finish_goto_ptr (loc,
- c_parser_expression (parser).value);
+ val = c_parser_expression (parser).value;
+ mark_exp_read (val);
+ stmt = c_finish_goto_ptr (loc, val);
}
else
c_parser_error (parser, "expected identifier or %<*%>");
+2010-10-18 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/46015
+ * semantics.c (finish_goto_stmt): Call mark_rvalue_use on computed
+ goto destination.
+
2010-10-17 Nicola Pero <nicola.pero@meta-innovation.com>
Merge from apple/trunk branch on FSF servers.
TREE_USED (destination) = 1;
else
{
+ destination = mark_rvalue_use (destination);
if (!processing_template_decl)
{
destination = cp_convert (ptr_type_node, destination);
+2010-10-18 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/46015
+ * c-c++-common/Wunused-var-13.c: New test.
+
2010-10-18 Richard Guenther <rguenther@suse.de>
PR tree-optimization/45967
--- /dev/null
+/* PR c/46015 */
+/* { dg-options "-Wunused" } */
+/* { dg-do compile } */
+
+int
+f1 (int i)
+{
+ static void *labs[2] = { &&lab1, &&lab2 };
+ goto *(labs[i & 1]);
+
+lab1:
+ return 1;
+lab2:
+ return 2;
+}
+
+int
+f2 (int i)
+{
+ void *labs[2] = { &&lab1, &&lab2 };
+ goto *labs[i & 1];
+
+lab1:
+ return 1;
+lab2:
+ return 2;
+}