]> gcc.gnu.org Git - gcc.git/commit
openmp: Fix C ICE on OpenMP atomics
authorJakub Jelinek <jakub@redhat.com>
Tue, 24 Nov 2020 08:04:28 +0000 (09:04 +0100)
committerJakub Jelinek <jakub@redhat.com>
Wed, 25 Nov 2020 11:55:26 +0000 (12:55 +0100)
commit1cd47144fd250f37206c8e2a0cc7d51c25ad368c
tree6dc4b4b63ed4b70809013a779e393ee4b00f4e22
parent05a3ab76e03ec6cff0bafb8495387b3a186785cc
openmp: Fix C ICE on OpenMP atomics

c_parser_binary_expression was using build2 to create a temporary holder
for binary expression that c_parser_atomic and c_finish_omp_atomic can then
handle.  The latter performs then all the needed checking.

Unfortunately, build2 performs some checking too, e.g. PLUS_EXPR vs.
POINTER_PLUS_EXPR or matching types of the arguments, nothing we can guarantee
at the parsing time.  So we need something like C++ build_min_nt*.  This
patch implements that inline.

2020-11-24  Jakub Jelinek  <jakub@redhat.com>

PR c/97958
* c-parser.c (c_parser_binary_expression): For omp atomic binary
expressions, use make_node instead of build2 to avoid checking build2
performs.

* c-c++-common/gomp/pr97958.c: New test.

(cherry picked from commit 2aaf44a90283156ec0e70ad4d9030f3ba5054c6f)
gcc/c/c-parser.c
gcc/testsuite/c-c++-common/gomp/pr97958.c [new file with mode: 0644]
This page took 0.058749 seconds and 6 git commands to generate.