aboutsummaryrefslogtreecommitdiff
path: root/gcc/c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2022-10-06 10:39:41 +0200
committerJakub Jelinek <jakub@redhat.com>2022-10-06 10:39:41 +0200
commit847f5addc4d07a2f3b95f5daa50ab4a64dfd957d (patch)
tree0ce51845a3d521b129664927810852f72e264775 /gcc/c
parent08b51baddc53d64aa4c5e7a81ef3c4bf320293be (diff)
downloadgcc-847f5addc4d07a2f3b95f5daa50ab4a64dfd957d.zip
gcc-847f5addc4d07a2f3b95f5daa50ab4a64dfd957d.tar.gz
gcc-847f5addc4d07a2f3b95f5daa50ab4a64dfd957d.tar.bz2
openmp: Map holds clause to IFN_ASSUME for C/C++
Now that [[assume (cond)]] support is in, this simple patch makes #pragma omp assume holds(cond) use it. 2022-10-06 Jakub Jelinek <jakub@redhat.com> * c-parser.cc (c_parser_omp_assumption_clauses): Emit IFN_ASSUME call for holds clause on assume construct. * parser.cc (cp_parser_omp_assumption_clauses): Emit IFN_ASSUME call for holds clause on assume construct. * c-c++-common/gomp/assume-4.c: New test.
Diffstat (limited to 'gcc/c')
-rw-r--r--gcc/c/c-parser.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/c/c-parser.cc b/gcc/c/c-parser.cc
index 9b76637..67b919c 100644
--- a/gcc/c/c-parser.cc
+++ b/gcc/c/c-parser.cc
@@ -23571,10 +23571,12 @@ c_parser_omp_assumption_clauses (c_parser *parser, bool is_assume)
tree t = convert_lvalue_to_rvalue (eloc, expr, true, true).value;
t = c_objc_common_truthvalue_conversion (eloc, t);
t = c_fully_fold (t, false, NULL);
- if (is_assume)
+ if (is_assume && t != error_mark_node)
{
- /* FIXME: Emit .ASSUME (t) call here. */
- (void) t;
+ tree fn = build_call_expr_internal_loc (eloc, IFN_ASSUME,
+ void_type_node, 1,
+ t);
+ add_stmt (fn);
}
parens.skip_until_found_close (parser);
}