gcc/libgomp/testsuite
Jakub Jelinek 9119f51f40 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.

(cherry picked from commit 91c771ec8a)
2021-07-18 13:01:39 +02:00
..
config Update copyright years. 2021-01-04 10:26:59 +01:00
lib libgomp/testsuite: Fix checks for dg-excess-errors 2021-04-27 18:09:21 +02:00
libgomp.c openmp: Fix up taskloop reduction ICE if taskloop has no iterations [PR100471] 2021-05-12 15:19:29 +02:00
libgomp.c-c++-common openmp - Fix up && and || reductions [PR94366] 2021-07-18 13:01:39 +02:00
libgomp.c++ openmp: Add support for non-VLA {,first}private allocate on omp task 2020-11-14 01:46:16 +01:00
libgomp.fortran tree-optimization/100981 - fix SLP patterns involving reductions 2021-06-16 14:08:34 +02:00
libgomp.graphite Update copyright years. 2021-01-04 10:26:59 +01:00
libgomp.oacc-c [testsuite] Unset 'offload_target' after use 2020-07-24 14:00:43 +02:00
libgomp.oacc-c-c++-common modulo-sched: skip loops with strange register defs [PR100225] 2021-05-06 14:55:26 +03:00
libgomp.oacc-c++ Fix templatized C++ OpenACC 'cache' directive ICEs 2020-11-25 19:57:39 +01:00
libgomp.oacc-fortran [OpenACC 'kernels'] '-fopenacc-kernels=[...]' -> '--param=openacc-kernels=[...]' 2021-04-19 14:29:48 +02:00
libgomp-site-extra.exp.in libgomp/test: Remove a build sysroot fix regression 2020-04-06 23:32:45 +01:00
libgomp-test-support.exp.in libgomp/test: Remove a build sysroot fix regression 2020-04-06 23:32:45 +01:00
Makefile.am libgomp/test: Remove a build sysroot fix regression 2020-04-06 23:32:45 +01:00
Makefile.in libgomp: Regenerate configure files with automake 1.15.1 2020-10-02 12:08:47 +02:00