From edbba2ceb53e6ebf98357d6036ee27b18cf5082c Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Fri, 23 May 2014 13:00:31 +0200 Subject: [PATCH] Fix some bool vs. tree confusion. gcc/c/ * c-parser.c (c_parser_omp_target): Return bool values. gcc/cp/ * parser.c (cp_parser_omp_target): Return bool values. From-SVN: r210851 --- gcc/c/ChangeLog | 4 ++++ gcc/c/c-parser.c | 14 +++++++++----- gcc/cp/ChangeLog | 4 ++++ gcc/cp/parser.c | 14 +++++++++----- 4 files changed, 26 insertions(+), 10 deletions(-) diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index 9acc6f70e29..c21f68f3a5c 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,7 @@ +2014-05-23 Thomas Schwinge + + * c-parser.c (c_parser_omp_target): Return bool values. + 2014-05-22 Thomas Schwinge * c-parser.c (c_parser_omp_clause_thread_limit): Rename diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c index a7e33b01f57..88edf36e98f 100644 --- a/gcc/c/c-parser.c +++ b/gcc/c/c-parser.c @@ -12720,15 +12720,19 @@ c_parser_omp_target (c_parser *parser, enum pragma_context context) c_parser_consume_token (parser); strcpy (p_name, "#pragma omp target"); if (!flag_openmp) /* flag_openmp_simd */ - return c_parser_omp_teams (loc, parser, p_name, - OMP_TARGET_CLAUSE_MASK, cclauses); + { + tree stmt = c_parser_omp_teams (loc, parser, p_name, + OMP_TARGET_CLAUSE_MASK, + cclauses); + return stmt != NULL_TREE; + } keep_next_level (); tree block = c_begin_compound_stmt (true); tree ret = c_parser_omp_teams (loc, parser, p_name, OMP_TARGET_CLAUSE_MASK, cclauses); block = c_end_compound_stmt (loc, block, true); - if (ret == NULL) - return ret; + if (ret == NULL_TREE) + return false; tree stmt = make_node (OMP_TARGET); TREE_TYPE (stmt) = void_type_node; OMP_TARGET_CLAUSES (stmt) = cclauses[C_OMP_CLAUSE_SPLIT_TARGET]; @@ -12739,7 +12743,7 @@ c_parser_omp_target (c_parser *parser, enum pragma_context context) else if (!flag_openmp) /* flag_openmp_simd */ { c_parser_skip_to_pragma_eol (parser); - return NULL_TREE; + return false; } else if (strcmp (p, "data") == 0) { diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index a594e9393f3..b9a22f96ff4 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +2014-05-23 Thomas Schwinge + + * parser.c (cp_parser_omp_target): Return bool values. + 2014-05-22 Paolo Carlini PR c++/61088 diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 7f06106f4ca..c4440af2314 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -30337,8 +30337,12 @@ cp_parser_omp_target (cp_parser *parser, cp_token *pragma_tok, cp_lexer_consume_token (parser->lexer); strcpy (p_name, "#pragma omp target"); if (!flag_openmp) /* flag_openmp_simd */ - return cp_parser_omp_teams (parser, pragma_tok, p_name, - OMP_TARGET_CLAUSE_MASK, cclauses); + { + tree stmt = cp_parser_omp_teams (parser, pragma_tok, p_name, + OMP_TARGET_CLAUSE_MASK, + cclauses); + return stmt != NULL_TREE; + } keep_next_level (true); tree sb = begin_omp_structured_block (); unsigned save = cp_parser_begin_omp_structured_block (parser); @@ -30346,8 +30350,8 @@ cp_parser_omp_target (cp_parser *parser, cp_token *pragma_tok, OMP_TARGET_CLAUSE_MASK, cclauses); cp_parser_end_omp_structured_block (parser, save); tree body = finish_omp_structured_block (sb); - if (ret == NULL) - return ret; + if (ret == NULL_TREE) + return false; tree stmt = make_node (OMP_TARGET); TREE_TYPE (stmt) = void_type_node; OMP_TARGET_CLAUSES (stmt) = cclauses[C_OMP_CLAUSE_SPLIT_TARGET]; @@ -30358,7 +30362,7 @@ cp_parser_omp_target (cp_parser *parser, cp_token *pragma_tok, else if (!flag_openmp) /* flag_openmp_simd */ { cp_parser_require_pragma_eol (parser, pragma_tok); - return NULL_TREE; + return false; } else if (strcmp (p, "data") == 0) { -- 2.30.2