aboutsummaryrefslogtreecommitdiff
path: root/gcc/dwarf2out.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2021-07-01 08:55:49 +0200
committerJakub Jelinek <jakub@redhat.com>2021-07-01 08:55:49 +0200
commit91c771ec8a3b649765de3e0a7b04cf946c6649ef (patch)
tree04986ff6554b6e58f6ea61494430d4ccf2bb7b7a /gcc/dwarf2out.c
parenta688c284dd3848b6c4ea553035f0f9769fb4fbc9 (diff)
downloadgcc-91c771ec8a3b649765de3e0a7b04cf946c6649ef.zip
gcc-91c771ec8a3b649765de3e0a7b04cf946c6649ef.tar.gz
gcc-91c771ec8a3b649765de3e0a7b04cf946c6649ef.tar.bz2
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.
Diffstat (limited to 'gcc/dwarf2out.c')
0 files changed, 0 insertions, 0 deletions