gcc/libgomp/testsuite
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 Update copyright years. 2021-01-04 10:26:59 +01:00
lib libgomp: Compile tests with -march=i486 only if needed 2021-06-09 10:05:40 -07:00
libgomp.c Add 'default' to -foffload=; document that flag [PR67300] 2021-06-29 16:00:04 +02:00
libgomp.c-c++-common openmp - Fix up && and || reductions [PR94366] 2021-07-01 08:55:49 +02:00
libgomp.c++ openmp: in_reduction clause support on target construct 2021-06-24 11:35:08 +02:00
libgomp.fortran libgomp.fortran/defaultmap-8.f90: Fix non-shared memory handling 2021-06-29 15:50:23 +02:00
libgomp.graphite Update copyright years. 2021-01-04 10:26:59 +01:00
libgomp.oacc-c
libgomp.oacc-c-c++-common [GCN] Fix run-time variable 'num_workers' 2021-06-08 12:00:15 +02:00
libgomp.oacc-c++ Don't require 'openacc_nvidia_accel_selected' in additional 'libgomp.oacc-*/declare-*' 2021-06-08 11:21:47 +02:00
libgomp.oacc-fortran Enable more 'libgomp.oacc-*/lib-*' testcases for non-'openacc_nvidia_accel_selected' 2021-06-08 11:51:45 +02:00
libgomp-site-extra.exp.in
libgomp-test-support.exp.in
Makefile.am
Makefile.in