aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-parser.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2011-12-15 18:29:25 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2011-12-15 18:29:25 +0100
commit7d1362bcd64fd5d774f9e3cbe2ae2498a74ae5c9 (patch)
treed9175cdfc130e51e03e7c8c63c71f7397b829930 /gcc/c-parser.c
parent323492f6f9c8509fc51ab52026b74d0ca783c0c3 (diff)
downloadgcc-7d1362bcd64fd5d774f9e3cbe2ae2498a74ae5c9.zip
gcc-7d1362bcd64fd5d774f9e3cbe2ae2498a74ae5c9.tar.gz
gcc-7d1362bcd64fd5d774f9e3cbe2ae2498a74ae5c9.tar.bz2
re PR c/51360 (spurious unused-but-set-variable warning for var used in OpenMP pragma)
PR c/51360 * c-parser.c (c_parser_omp_clause_num_threads, c_parser_omp_clause_schedule): Call mark_exp_read. * semantics.c (finish_omp_clauses): For OMP_CLAUSE_NUM_THREADS_EXPR and OMP_CLAUSE_SCHEDULE_CHUNK_EXPR call mark_rvalue_use. * c-c++-common/gomp/pr51360.c: New test. * g++.dg/gomp/pr51360.C: New test. From-SVN: r182381
Diffstat (limited to 'gcc/c-parser.c')
-rw-r--r--gcc/c-parser.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/c-parser.c b/gcc/c-parser.c
index e227137..0a268a6 100644
--- a/gcc/c-parser.c
+++ b/gcc/c-parser.c
@@ -9011,6 +9011,7 @@ c_parser_omp_clause_num_threads (c_parser *parser, tree list)
{
location_t expr_loc = c_parser_peek_token (parser)->location;
tree c, t = c_parser_expression (parser).value;
+ mark_exp_read (t);
t = c_fully_fold (t, false, NULL);
c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, "expected %<)%>");
@@ -9218,6 +9219,7 @@ c_parser_omp_clause_schedule (c_parser *parser, tree list)
here = c_parser_peek_token (parser)->location;
t = c_parser_expr_no_commas (parser, NULL).value;
+ mark_exp_read (t);
t = c_fully_fold (t, false, NULL);
if (OMP_CLAUSE_SCHEDULE_KIND (c) == OMP_CLAUSE_SCHEDULE_RUNTIME)