PR c/35738
* c-parser.c (c_parser_omp_atomic): Call
default_function_array_conversion on the RHS.
* gcc.dg/gomp/pr35738.c: New test.
From-SVN: r133876
2008-04-03 Jakub Jelinek <jakub@redhat.com>
+ PR c/35738
+ * c-parser.c (c_parser_omp_atomic): Call
+ default_function_array_conversion on the RHS.
+
PR middle-end/35818
* omp-low.c (scan_sharing_clauses) <case OMP_CLAUSE_SHARED>: Don't
call is_variable_sized if decl has incomplete type.
tree lhs, rhs;
tree stmt;
enum tree_code code;
+ struct c_expr rhs_expr;
c_parser_skip_to_pragma_eol (parser);
}
c_parser_consume_token (parser);
- rhs = c_parser_expression (parser).value;
+ rhs_expr = c_parser_expression (parser);
+ rhs_expr = default_function_array_conversion (rhs_expr);
+ rhs = rhs_expr.value;
break;
}
stmt = c_finish_omp_atomic (code, lhs, rhs);
2008-04-03 Jakub Jelinek <jakub@redhat.com>
+ PR c/35738
+ * gcc.dg/gomp/pr35738.c: New test.
+
PR middle-end/35818
* gcc.dg/gomp/pr35818.c: New test.
--- /dev/null
+/* PR c/35738 */
+/* { dg-do compile } */
+/* { dg-options "-fopenmp" } */
+
+void foo (void);
+
+void
+bar (void *p)
+{
+ int i = 0;
+ char q[10];
+#pragma omp atomic
+ i += q; /* { dg-warning "makes integer from pointer without a cast" } */
+#pragma omp atomic
+ i += foo; /* { dg-warning "makes integer from pointer without a cast" } */
+#pragma omp atomic
+ i += p; /* { dg-warning "makes integer from pointer without a cast" } */
+}