gcc/libgomp
Jakub Jelinek 91c771ec8a openmp - Fix up && and || reductions [PR94366]
As the testcase shows, the special treatment of && and || reduction combiners
where we expand them as omp_out = (omp_out != 0) && (omp_in != 0) (or with ||)
is not needed just for &&/|| on floating point or complex types, but for all
&&/|| reductions - when expanded as omp_out = omp_out && omp_in (not in C but
GENERIC) it is actually gimplified into NOP_EXPRs to bool from both operands,
which turns non-zero values multiple of 2 into 0 rather than 1.

This patch just treats all &&/|| the same and furthermore uses bool type
instead of int for the comparisons.

2021-07-01  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/94366
gcc/
	* omp-low.c (lower_rec_input_clauses): Rename is_fp_and_or to
	is_truth_op, set it for TRUTH_*IF_EXPR regardless of new_var's type,
	use boolean_type_node instead of integer_type_node as NE_EXPR type.
	(lower_reduction_clauses): Likewise.
libgomp/
	* testsuite/libgomp.c-c++-common/pr94366.c: New test.
2021-07-01 08:55:49 +02:00
..
config
plugin
testsuite openmp - Fix up && and || reductions [PR94366] 2021-07-01 08:55:49 +02:00
.gitattributes
acc_prof.h
acinclude.m4
aclocal.m4
affinity-fmt.c
affinity.c
alloc.c
allocator.c
atomic.c
barrier.c
ChangeLog Daily bump. 2021-06-30 00:16:52 +00:00
ChangeLog.graphite
config.h.in
configure
configure.ac
configure.tgt
critical.c
env.c
error.c
fortran.c
hashtab.h libgomp: Structure element mapping for OpenMP 5.0 2021-06-17 21:34:59 +08:00
icv-device.c
icv.c
iter_ull.c
iter.c
libgomp_f.h.in
libgomp_g.h OpenACC: Separate enter/exit data ABIs 2021-06-10 13:37:13 +02:00
libgomp-plugin.c
libgomp-plugin.h
libgomp.h libgomp: Structure element mapping for OpenMP 5.0 2021-06-17 21:34:59 +08:00
libgomp.map OpenACC: Separate enter/exit data ABIs 2021-06-10 13:37:13 +02:00
libgomp.spec.in
libgomp.texi
lock.c
loop_ull.c
loop.c
Makefile.am
Makefile.in
oacc-async.c
oacc-cuda.c
oacc-host.c
oacc-init.c
oacc-int.h
oacc-mem.c libgomp: Structure element mapping for OpenMP 5.0 2021-06-17 21:34:59 +08:00
oacc-parallel.c libgomp: Structure element mapping for OpenMP 5.0 2021-06-17 21:34:59 +08:00
oacc-plugin.c
oacc-plugin.h
oacc-profiling.c
oacc-target.c
omp_lib.f90.in
omp_lib.h.in
omp.h.in
openacc_lib.h
openacc.f90
openacc.h
ordered.c
parallel.c
priority_queue.c
priority_queue.h
sections.c
secure_getenv.h
single.c
splay-tree.c
splay-tree.h
target.c libgomp: Structure element mapping for OpenMP 5.0 2021-06-17 21:34:59 +08:00
task.c
taskloop.c
team.c
teams.c
work.c