diff options
author | Tobias Burnus <tobias@codesourcery.com> | 2021-05-04 13:38:03 +0200 |
---|---|---|
committer | Tobias Burnus <tobias@codesourcery.com> | 2021-05-04 14:42:26 +0200 |
commit | 1580fc764423bf89e9b853aaa8c65999e37ccb8b (patch) | |
tree | 36f6858bdddd10b59525a1dca23df6bd03bb93d1 /gcc/cse.c | |
parent | 9174343256c06f7879f480c59203c1615601055c (diff) | |
download | gcc-1580fc764423bf89e9b853aaa8c65999e37ccb8b.zip gcc-1580fc764423bf89e9b853aaa8c65999e37ccb8b.tar.gz gcc-1580fc764423bf89e9b853aaa8c65999e37ccb8b.tar.bz2 |
OpenMP: Support complex/float in && and || reduction
C/C++ permit logical AND and logical OR also with floating-point or complex
arguments by doing an unequal zero comparison; the result is an 'int' with
value one or zero. Hence, those are also permitted as reduction variable,
even though it is not the most sensible thing to do.
gcc/c/ChangeLog:
* c-typeck.c (c_finish_omp_clauses): Accept float + complex
for || and && reductions.
gcc/cp/ChangeLog:
* semantics.c (finish_omp_reduction_clause): Accept float + complex
for || and && reductions.
gcc/ChangeLog:
* omp-low.c (lower_rec_input_clauses, lower_reduction_clauses): Handle
&& and || with floating-point and complex arguments.
gcc/testsuite/ChangeLog:
* gcc.dg/gomp/clause-1.c: Use 'reduction(&:..)' instead of '...(&&:..)'.
libgomp/ChangeLog:
* testsuite/libgomp.c-c++-common/reduction-1.c: New test.
* testsuite/libgomp.c-c++-common/reduction-2.c: New test.
* testsuite/libgomp.c-c++-common/reduction-3.c: New test.
Diffstat (limited to 'gcc/cse.c')
0 files changed, 0 insertions, 0 deletions