Backport from mainline
2011-05-23 Jakub Jelinek <jakub@redhat.com>
PR c/49120
* c-decl.c (start_decl): Convert expr to void_type_node.
* gcc.dg/pr49120.c: New test.
From-SVN: r176450
Backport from mainline
2011-05-23 Jakub Jelinek <jakub@redhat.com>
+ PR c/49120
+ * c-decl.c (start_decl): Convert expr to void_type_node.
+
PR middle-end/48973
* expr.c (expand_expr_real_2) <case LT_EXPR>: If do_store_flag
failed and the comparison has a single bit signed type, use
return 0;
if (expr)
- add_stmt (expr);
+ add_stmt (fold_convert (void_type_node, expr));
if (TREE_CODE (decl) != FUNCTION_DECL && MAIN_NAME_P (DECL_NAME (decl)))
warning (OPT_Wmain, "%q+D is usually a function", decl);
Backport from mainline
2011-05-23 Jakub Jelinek <jakub@redhat.com>
+ PR c/49120
+ * c-decl.c (start_decl): Convert expr to void_type_node.
+
PR middle-end/48973
* gcc.c-torture/execute/pr48973-1.c: New test.
* gcc.c-torture/execute/pr48973-2.c: New test.
--- /dev/null
+/* PR c/49120 */
+/* { dg-do compile } */
+/* { dg-options "-Wall" } */
+
+int
+main ()
+{
+ int a = 1;
+ int c = ({ char b[a + 1]; b[0] = 0; b[0]; });
+ return c;
+}