aboutsummaryrefslogtreecommitdiff
path: root/gcc
AgeCommit message (Collapse)AuthorFilesLines
2022-06-21Handle references in OpenACC "private" clausesJulian Brown2-0/+20
gcc/ * gimplify.cc (localize_reductions): Rewrite references for OMP_CLAUSE_PRIVATE also.
2022-06-21Silence compiler warningsTobias Burnus2-1/+4
gcc/ 2019-09-17 Tobias Burnus <tobias@codesourcery.com> * gimplify.cc (gomp_oacc_needs_data_present): Remove unused variable.
2022-06-21Update expected messages, errors and warnings for "kernels" testsJulian Brown6-48/+59
gcc/testsuite/ * c-c++-common/goacc/note-parallelism-1-kernels-loop-auto.c: Update expected message/warning/error output. * c-c++-common/goacc/note-parallelism-1-kernels-straight-line.c: Likewise. * c-c++-common/goacc/note-parallelism-combined-kernels-loop-auto.c: Likewise. * c-c++-common/goacc/note-parallelism-kernels-loop-auto.c: Likewise. * c-c++-common/goacc/routine-1.c: Likewise.
2022-06-21Use more appropriate var in localize_reductions callJulian Brown2-1/+7
gcc/ * gimplify.cc (gimplify_omp_for): Use for_stmt in call to localize_reductions.
2022-06-21Fix tree check failure with reduction localizationJulian Brown2-2/+6
gcc/ * gimplify.cc (gimplify_omp_workshare): Use OMP_CLAUSES, OMP_BODY instead of OMP_TARGET_CLAUSES, OMP_TARGET_BODY.
2022-06-21Reference reduction localizationJulian Brown6-35/+138
gcc/ * gimplify.cc (privatize_reduction): New struct. (localize_reductions_r, localize_reductions): New functions. (gimplify_omp_for): Call localize_reductions. (gimplify_omp_workshare): Likewise. * omp-low.cc (lower_oacc_reductions): Handle localized reductions. Create fewer temp vars. * tree-core.h (omp_clause_code): Add OMP_CLAUSE_REDUCTION_PRIVATE_DECL documentation. * tree.cc (omp_clause_num_ops): Bump number of ops for OMP_CLAUSE_REDUCTION to 6. (walk_tree_1): Adjust accordingly. * tree.h (OMP_CLAUSE_REDUCTION_PRIVATE_DECL): Add macro.
2022-06-21Assumed-size arrays with non-lexical data mappingsJulian Brown5-9/+45
gcc/ * gimplify.cc (gimplify_adjust_omp_clauses_1): Raise error for assumed-size arrays in map clauses for Fortran/OpenMP. * omp-low.cc (lower_omp_target): Set the size of assumed-size Fortran arrays to one to allow use of data already mapped on the offload device. gcc/fortran/ * trans-openmp.cc (gfc_omp_finish_clause): Change clauses mapping assumed-size arrays to use the GOMP_MAP_FORCE_PRESENT map type.
2022-06-21Fix expected messages in goacc testsKwok Cheung Yeung12-324/+347
The expected messages in the OpenACC kernel-related tests should be prefixed with 'optimized:' rather than 'note:'. 2019-05-31 Kwok Cheung Yeung <kcy@codesourcery.com> gcc/testsuite/ * c-c++-common/goacc/kernels-decompose-1.c: Change 'note:' to 'optimized:'. Fix typo. * c-c++-common/goacc/note-parallelism-1-kernels-conditional-loop-independent_seq.c: Change 'note:' to 'optimized:'. * c-c++-common/goacc/note-parallelism-1-kernels-loop-auto.c: Likewise. * c-c++-common/goacc/note-parallelism-1-kernels-loop-independent_seq.c: Likewise. * c-c++-common/goacc/note-parallelism-1-kernels-loops.c: Likewise. * c-c++-common/goacc/note-parallelism-1-kernels-straight-line.c: Likewise. * c-c++-common/goacc/note-parallelism-combined-kernels-loop-auto.c: Likewise. * c-c++-common/goacc/note-parallelism-combined-kernels-loop-independent_seq.c: Likewise. * c-c++-common/goacc/note-parallelism-kernels-conditional-loop-independent_seq.c: Likewise. * c-c++-common/goacc/note-parallelism-kernels-loop-auto.c: Likewise. * c-c++-common/goacc/note-parallelism-kernels-loop-independent_seq.c: Likewise. * c-c++-common/goacc/note-parallelism-kernels-loops.c: Likewise.
2022-06-21Fix lexically-nested data mappings for no_alloc or optional argumentsJulian Brown2-4/+13
gcc/ * gimplify.cc (gimplify_adjust_omp_clauses_1): Support implied no_alloc and optional arguments based on mappings in enclosing data regions.
2022-06-21Fix references declared in lexically-enclosing OpenACC data regionJulian Brown4-7/+60
gcc/fortran/ * trans-openmp.cc (gfc_omp_finish_clause): Guard addition of clauses for pointers with DECL_P. gcc/ * gimplify.cc (oacc_array_mapping_info): Add REF field. (gimplify_scan_omp_clauses): Initialise above field for data blocks passed by reference. (gomp_oacc_needs_data_present): Handle references. (gimplify_adjust_omp_clauses_1): Handle references and optional arguments for variables declared in lexically-enclosing OpenACC data region.
2022-06-21Make new OpenACC kernels conversion the default; adjust and add testsThomas Schwinge22-19/+1338
gcc/ * params.opt (openacc_kernels): Default to decompose. gcc/testsuite/ * c-c++-common/goacc/classify-kernels-unparallelized.c: Update. * c-c++-common/goacc/classify-kernels.c: Likewise. * c-c++-common/goacc/classify-parallel.c: Likewise. * c-c++-common/goacc/classify-routine.c: Likewise. * c-c++-common/goacc/loop-2-kernels.c: Likewise. * c-c++-common/goacc/note-parallelism-1-kernels-conditional-loop-independent_seq.c: New file. * c-c++-common/goacc/note-parallelism-1-kernels-loop-auto.c: Likewise. * c-c++-common/goacc/note-parallelism-1-kernels-loop-independent_seq.c: Likewise. * c-c++-common/goacc/note-parallelism-1-kernels-loops.c: Likewise. * c-c++-common/goacc/note-parallelism-1-kernels-straight-line.c: Likewise. * c-c++-common/goacc/note-parallelism-combined-kernels-loop-auto.c: Likewise. * c-c++-common/goacc/note-parallelism-combined-kernels-loop-independent_seq.c: Likewise. * c-c++-common/goacc/note-parallelism-kernels-conditional-loop-independent_seq.c: Likewise. * c-c++-common/goacc/note-parallelism-kernels-loop-auto.c: Likewise. * c-c++-common/goacc/note-parallelism-kernels-loop-independent_seq.c: Likewise. * c-c++-common/goacc/note-parallelism-kernels-loops.c: Likewise. * c-c++-common/goacc/note-parallelism.c: Likewise. * c-c++-common/goacc/routine-1.c: Likewise. * c-c++-common/goacc/uninit-dim-clause.c: Likewise.
2022-06-21Use "--param=openacc-kernels=parloops" to document "parloops" test casesThomas Schwinge53-0/+165
gcc/testsuite/ * c-c++-common/goacc/kernels-1.c: Add "--param=openacc-kernels=parloops". * c-c++-common/goacc/kernels-acc-loop-reduction.c: Likewise. * c-c++-common/goacc/kernels-acc-loop-smaller-equal.c: Likewise. * c-c++-common/goacc/kernels-alias-2.c: Likewise. * c-c++-common/goacc/kernels-alias-3.c: Likewise. * c-c++-common/goacc/kernels-alias-4.c: Likewise. * c-c++-common/goacc/kernels-alias-5.c: Likewise. * c-c++-common/goacc/kernels-alias-6.c: Likewise. * c-c++-common/goacc/kernels-alias-7.c: Likewise. * c-c++-common/goacc/kernels-alias-8.c: Likewise. * c-c++-common/goacc/kernels-alias-ipa-pta-2.c: Likewise. * c-c++-common/goacc/kernels-alias-ipa-pta-3.c: Likewise. * c-c++-common/goacc/kernels-alias-ipa-pta-4.c: Likewise. * c-c++-common/goacc/kernels-alias-ipa-pta.c: Likewise. * c-c++-common/goacc/kernels-alias.c: Likewise. * c-c++-common/goacc/kernels-counter-var-redundant-load.c: Likewise. * c-c++-common/goacc/kernels-counter-vars-function-scope.c: Likewise. * c-c++-common/goacc/kernels-double-reduction-n.c: Likewise. * c-c++-common/goacc/kernels-double-reduction.c: Likewise. * c-c++-common/goacc/kernels-loop-2-acc-loop.c: Likewise. * c-c++-common/goacc/kernels-loop-2.c: Likewise. * c-c++-common/goacc/kernels-loop-3-acc-loop.c: Likewise. * c-c++-common/goacc/kernels-loop-3.c: Likewise. * c-c++-common/goacc/kernels-loop-acc-loop.c: Likewise. * c-c++-common/goacc/kernels-loop-data-2.c: Likewise. * c-c++-common/goacc/kernels-loop-data-enter-exit-2.c: Likewise. * c-c++-common/goacc/kernels-loop-data-enter-exit.c: Likewise. * c-c++-common/goacc/kernels-loop-data-update.c: Likewise. * c-c++-common/goacc/kernels-loop-data.c: Likewise. * c-c++-common/goacc/kernels-loop-g.c: Likewise. * c-c++-common/goacc/kernels-loop-mod-not-zero.c: Likewise. * c-c++-common/goacc/kernels-loop-n-acc-loop.c: Likewise. * c-c++-common/goacc/kernels-loop-n.c: Likewise. * c-c++-common/goacc/kernels-loop-nest.c: Likewise. * c-c++-common/goacc/kernels-loop.c: Likewise. * c-c++-common/goacc/kernels-one-counter-var.c: Likewise. * c-c++-common/goacc/kernels-parallel-loop-data-enter-exit.c: Likewise. * c-c++-common/goacc/kernels-reduction.c: Likewise. * gfortran.dg/goacc/kernels-alias-2.f95: Likewise. * gfortran.dg/goacc/kernels-alias-3.f95: Likewise. * gfortran.dg/goacc/kernels-alias-4.f95: Likewise. * gfortran.dg/goacc/kernels-alias.f95: Likewise. * gfortran.dg/goacc/kernels-loop-2.f95: Likewise. * gfortran.dg/goacc/kernels-loop-data-2.f95: Likewise. * gfortran.dg/goacc/kernels-loop-data-enter-exit-2.f95: Likewise. * gfortran.dg/goacc/kernels-loop-data-enter-exit.f95: Likewise. * gfortran.dg/goacc/kernels-loop-data-update.f95: Likewise. * gfortran.dg/goacc/kernels-loop-data.f95: Likewise. * gfortran.dg/goacc/kernels-loop-inner.f95: Likewise. * gfortran.dg/goacc/kernels-loop-n.f95: Likewise. * gfortran.dg/goacc/kernels-loop.f95: Likewise. * gfortran.dg/goacc/kernels-loops-adjacent.f95: Likewise. * gfortran.dg/goacc/kernels-parallel-loop-data-enter-exit.f95: Likewise. libgomp/ * testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pta-2.c: Add "--param=openacc-kernels=parloops". * testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pta-3.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pta.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/kernels-empty.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/kernels-loop-2.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/kernels-loop-3.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/kernels-loop-and-seq-2.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/kernels-loop-and-seq-3.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/kernels-loop-and-seq-4.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/kernels-loop-and-seq-5.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/kernels-loop-and-seq-6.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/kernels-loop-and-seq.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/kernels-loop-collapse.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/kernels-loop-data-2.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/kernels-loop-data-enter-exit-2.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/kernels-loop-data-enter-exit.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/kernels-loop-data-update.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/kernels-loop-data.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/kernels-loop-g.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/kernels-loop-mod-not-zero.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/kernels-loop-n.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/kernels-loop-nest.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/kernels-loop.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/kernels-parallel-loop-data-enter-exit.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/kernels-reduction-1.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/kernels-reduction.c: Likewise. * testsuite/libgomp.oacc-fortran/kernels-loop-2.f95: Likewise. * testsuite/libgomp.oacc-fortran/kernels-loop-data-2.f95: Likewise. * testsuite/libgomp.oacc-fortran/kernels-loop-data-enter-exit-2.f95: Likewise. * testsuite/libgomp.oacc-fortran/kernels-loop-data-enter-exit.f95: Likewise. * testsuite/libgomp.oacc-fortran/kernels-loop-data-update.f95: Likewise. * testsuite/libgomp.oacc-fortran/kernels-loop-data.f95: Likewise. * testsuite/libgomp.oacc-fortran/kernels-loop.f95: Likewise. * testsuite/libgomp.oacc-fortran/kernels-parallel-loop-data-enter-exit.f95: Likewise. * testsuite/libgomp.oacc-fortran/kernels-reduction-1.f90: Likewise.
2022-06-21Enable firstprivate OpenACC reductionsJulian Brown4-7/+117
2018-09-05 Cesar Philippidis <cesar@codesourcery.com> Chung-Lin Tang <cltang@codesourcery.com> gcc/ * gimplify.cc (omp_add_variable): Enable firstprivate reduction variables. gcc/testsuite/ * c-c++-common/goacc/reduction-8.c: New test. libgomp/ * testsuite/libgomp.oacc-c-c++-common/privatize-reduction-1.c: New test. * testsuite/libgomp.oacc-c-c++-common/privatize-reduction-2.c: New test.
2022-06-21Don't mark OpenACC auto loops as independent inside acc parallel regionsJulian Brown8-30/+212
2018-09-20 Cesar Philippidis <cesar@codesourcery.com> gcc/ * omp-low.cc (lower_oacc_head_mark): Don't mark OpenACC auto loops as independent inside acc parallel regions. gcc/testsuite/ * c-c++-common/goacc/loop-auto-1.c: Adjust test case to conform to the new behavior of the auto clause in OpenACC 2.5. * c-c++-common/goacc/loop-auto-2.c: Likewise. * gcc.dg/goacc/loop-processing-1.c: Likewise. * c-c++-common/goacc/loop-auto-3.c: New test. * gfortran.dg/goacc/loop-auto-1.f90: New test. libgomp/ * testsuite/libgomp.oacc-c-c++-common/loop-auto-1.c: Adjust test case to conform to the new behavior of the auto clause in OpenACC 2.5.
2022-06-21Enable GOMP_MAP_FIRSTPRIVATE_INT for OpenACCJulian Brown2-12/+145
2018-12-22 Cesar Philippidis <cesar@codesourcery.com> Julian Brown <julian@codesourcery.com> Tobias Burnus <tobias@codesourcery.com> gcc/ * omp-low.cc (maybe_lookup_field_in_outer_ctx): New function. (convert_to_firstprivate_int): New function. (convert_from_firstprivate_int): New function. (lower_omp_target): Enable GOMP_MAP_FIRSTPRIVATE_INT in OpenACC. Remove unused variable. libgomp/ * oacc-parallel.c (GOACC_parallel_keyed): Handle GOMP_MAP_FIRSTPRIVATE_INT host addresses. * plugin/plugin-nvptx.c (nvptx_exec): Handle GOMP_MAP_FIRSTPRIVATE_INT host addresses. * testsuite/libgomp.oacc-c++/firstprivate-int.C: New test. * testsuite/libgomp.oacc-c-c++-common/firstprivate-int.c: New test. * testsuite/libgomp.oacc-fortran/firstprivate-int.f90: New test.
2022-06-21Fix implicit mapping for array slices on lexically-enclosing data constructs ↵Julian Brown7-7/+223
(PR70828) 2018-08-28 Julian Brown <julian@codesourcery.com> Cesar Philippidis <cesar@codesourcery.com> gcc/ * gimplify.cc (oacc_array_mapping_info): New struct. (gimplify_omp_ctx): Add decl_data_clause hash map. (new_omp_context): Zero-initialise above. (delete_omp_context): Delete above if allocated. (gimplify_scan_omp_clauses): Scan for array mappings on data constructs, and record in above map. (gomp_oacc_needs_data_present): New function. (gimplify_adjust_omp_clauses_1): Handle data mappings (e.g. array slices) declared in lexically-enclosing data constructs. * omp-low.cc (lower_omp_target): Allow decl for bias not to be present in OpenACC context. gcc/testsuite/ * c-c++-common/goacc/acc-data-chain.c: New test. * gfortran.dg/goacc/pr70828.f90: New test. libgomp/ * testsuite/libgomp.oacc-c-c++-common/pr70828.c: New test. * testsuite/libgomp.oacc-fortran/implicit_copy.f90: New test. * testsuite/libgomp.oacc-fortran/pr70828.f90: New test. * testsuite/libgomp.oacc-fortran/pr70828-2.f90: New test. * testsuite/libgomp.oacc-fortran/pr70828-3.f90: New test. * testsuite/libgomp.oacc-fortran/pr70828-4.f90: New test. * testsuite/libgomp.oacc-fortran/pr70828-5.f90: New test. * testsuite/libgomp.oacc-fortran/pr70828-6.f90: New test.
2022-06-21Default compute dimensions (compile time)Julian Brown8-16/+50
Typo fix relative to last posted version. 2018-10-05 Nathan Sidwell <nathan@acm.org> Tom de Vries <tdevries@suse.de> Thomas Schwinge <thomas@codesourcery.com> Julian Brown <julian@codesourcery.com> gcc/ * doc/invoke.texi (fopenacc-dim): Update. * omp-offload.cc (oacc_parse_default_dims): Update. gcc/testsuite/ * c-c++-common/goacc/acc-icf.c: Update. * c-c++-common/goacc/parallel-dims-1.c: Likewise. * gfortran.dg/goacc/routine-4.f90: Likewise. * gfortran.dg/goacc/routine-multiple-directives-1.f90: Likewise. libgomp/ * testsuite/libgomp.oacc-c-c++-common/loop-default-compile.c: New. * testsuite/libgomp.oacc-c-c++-common/loop-warn-1.c: New. * testsuite/libgomp.oacc-c-c++-common/parallel-dims.c: Update.
2022-06-21Generate sequential loop for OpenACC loop directive inside kernelsJulian Brown9-44/+230
2019-09-20 Chung-Lin Tang <cltang@codesourcery.com> Cesar Philippidis <cesar@codesourcery.com> gcc/ * omp-expand.cc (struct omp_region): Add inside_kernels_p field. (expand_omp_for_generic): Adjust to generate a 'sequential' loop when GOMP builtin arguments are BUILT_IN_NONE. (expand_omp_for): Use expand_omp_for_generic to generate a non-parallelized loop for OMP_FORs inside OpenACC kernels regions. (expand_omp): Mark inside_kernels_p field true for regions nested inside OpenACC kernels constructs. gcc/testsuite/ * c-c++-common/goacc/kernels-loop-acc-loop.c: New test. * c-c++-common/goacc/kernels-loop-2-acc-loop.c: New test. * c-c++-common/goacc/kernels-loop-3-acc-loop.c: New test. * c-c++-common/goacc/kernels-loop-n-acc-loop.c: New test. * c-c++-common/goacc/kernels-acc-loop-reduction.c: New test. * c-c++-common/goacc/kernels-acc-loop-smaller-equal.c: New test.
2022-06-21Reinstate kernels-restrict behaviourJulian Brown2-6/+91
This patch contains a small fix for upstream churn relative to the last version posted. 2018-09-20 Cesar Philippidis <cesar@codesourcery.com> Julian Brown <julian@codesourcery.com> * omp-low.c (install_var_field): New base_pointer_restrict argument. (scan_sharing_clauses): Update call to install_var_field. (omp_target_base_pointers_restrict_p): New function. (scan_omp_target): Update call to install_var_field.
2022-06-21Adjustments and additions to testcasesJulian Brown4-0/+142
Some additions of redundant "present" clauses dropped. 2018-10-22 Cesar Philippidis <cesar@codesourcery.com> gcc/testsuite/ * g++.dg/goacc/loop-1.c: New test. * g++.dg/goacc/loop-2.c: New test. * g++.dg/goacc/loop-3.c: New test. 2018-10-22 James Norris <jnorris@codesourcery.com> Cesar Philippidis <cesar@codesourcery.com> Tom de Vries <tom@codesourcery.com> libgomp/ * testsuite/libgomp.oacc-fortran/data-3.f90: Update parallel regions to denote variables copyied in via acc enter data as present. * testsuite/libgomp.oacc-c-c++-common/subr.h: Reimplement. * testsuite/libgomp.oacc-c-c++-common/subr.ptx: Regenerated PTX. * testsuite/libgomp.oacc-c-c++-common/timer.h: Removed. * testsuite/libgomp.oacc-c-c++-common/lib-69.c: Change async checks. * testsuite/libgomp.oacc-c-c++-common/lib-70.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/lib-72.c: Rework kernel i/f and change async checks. * testsuite/libgomp.oacc-c-c++-common/lib-73.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/lib-74.c: Rework kernel i/f and timing checks. * testsuite/libgomp.oacc-c-c++-common/lib-75.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/lib-76.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/lib-78.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/lib-79.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/lib-81.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/lib-82.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/lib-93.c: New test.
2022-06-21Various OpenACC reduction enhancements - test casesJulian Brown5-5/+675
2018-12-13 Cesar Philippidis <cesar@codesourcery.com> Nathan Sidwell <nathan@acm.org> Julian Brown <julian@codesourcery.com> gcc/testsuite/ * c-c++-common/goacc/orphan-reductions-1.c: New test. * c-c++-common/goacc/reduction-7.c: New test. * c-c++-common/goacc/routine-4.c: Update. * g++.dg/goacc/reductions-1.C: New test. * gcc.dg/goacc/loop-processing-1.c: Update. * gfortran.dg/goacc/orphan-reductions-1.f90: New test. libgomp/ * testsuite/libgomp.oacc-c-c++-common/par-reduction-3.c: New test. * testsuite/libgomp.oacc-c-c++-common/reduction-cplx-flt-2.c: New test. * testsuite/libgomp.oacc-fortran/reduction-9.f90: New test.
2022-06-21Various OpenACC reduction enhancements - ME and nvptx changesJulian Brown7-30/+283
Parts of the first posting got lost in the second posting, above. This version hopefully contains everything. 2018-10-30 Cesar Philippidis <cesar@codesourcery.com> gcc/ * config/nvptx/nvptx.cc (nvptx_propagate_unified): New. (nvptx_split_blocks): Call it for cond_uni insn. (nvptx_expand_cond_uni): New. (enum nvptx_builtins): Add NVPTX_BUILTIN_COND_UNI. (nvptx_init_builtins): Initialize it. (nvptx_expand_builtin): (nvptx_generate_vector_shuffle): Change integral SHIFT operand to tree BITS operand. (nvptx_vector_reduction): New. (nvptx_adjust_reduction_type): New. (nvptx_goacc_reduction_setup): Use it to adjust the type of ref_to_res. (nvptx_goacc_reduction_init): Don't update LHS if it doesn't exist. (nvptx_goacc_reduction_fini): Call nvptx_vector_reduction for vector. Use it to adjust the type of ref_to_res. (nvptx_goacc_reduction_teardown): * config/nvptx/nvptx.md (cond_uni): New pattern.
2022-06-21Various OpenACC reduction enhancements - FE changesJulian Brown9-42/+164
This version differs somewhat from the last version posted upstream (and addresses some of Jakub's review comments). 2018-12-13 Cesar Philippidis <cesar@codesourcery.com> Nathan Sidwell <nathan@acm.org> Julian Brown <julian@codesourcery.com> gcc/c/ * c-parser.cc (c_parser_omp_variable_list): New c_omp_region_type argument. Use it to specialize handling of OMP_CLAUSE_REDUCTION for OpenACC. (c_parser_oacc_data_clause): Add region-type argument. (c_parser_oacc_data_clause_deviceptr): Likewise. (c_parser_omp_clause_reduction): Change is_omp boolean parameter to c_omp_region_type. Update call to c_parser_omp_variable_list. (c_parser_oacc_all_clauses): Update calls to c_parser_omp_clause_reduction. (c_parser_omp_all_clauses): Likewise. (c_parser_oacc_cache): Update call to c_parser_omp_var_list_parens. * c-typeck.cc (c_finish_omp_clauses): Emit an error on orphan OpenACC gang reductions. Suppress user-defined reduction error for OpenACC. gcc/cp/ * parser.cc (cp_parser_omp_var_list_no_open): New c_omp_region_type argument. Use it to specialize handling of OMP_CLAUSE_REDUCTION for OpenACC. (cp_parser_omp_var_list): Add c_omp_region_type argument. Update call to cp_parser_omp_var_list_parens. (cp_parser_oacc_data_clause): Update call to cp_parser_omp_var_list. (cp_parser_omp_clause_reduction): Change is_omp boolean parameter to c_omp_region_type. Update call to cp_parser_omp_var_list_no_open. (cp_parser_oacc_all_clauses): Update call to cp_parser_omp_clause_reduction. (cp_parser_omp_all_clauses): Likewise. * semantics.cc (finish_omp_reduction_clause): Add c_omp_region_type argument. Suppress user-defined reduction error for OpenACC. (finish_omp_clauses): Emit an error on orphan OpenACC gang reductions. gcc/fortran/ * openmp.cc (oacc_is_parallel): New. (resolve_oacc_loop_blocks): Emit an error on orphan OpenACC gang reductions. * trans-openmp.cc (gfc_omp_clause_copy_ctor): Permit reductions. 2022-02-03 Kwok Cheung Yeung <kcy@codesourcery.com> gcc/c/ * c-parser.cc (c_parser_omp_clause_map): Update call to c_parser_omp_variable_list. (c_parser_omp_clause_to): Update call to c_parser_omp_var_list_parens. (c_parser_omp_clause_from): Likewise. gcc/cp/ * parser.cc (cp_parser_omp_clause_map): Update call to cp_parser_omp_var_list_no_open. (cp_parser_omp_all_clauses): Update calls to cp_parser_omp_var_list.
2022-06-21Add OpenACC Fortran support for deviceptr and variable in common blocksJulian Brown12-35/+80
2018-06-29 Cesar Philippidis <cesar@codesourcery.com> James Norris <jnorris@codesourcery.com> gcc/fortran/ * openmp.cc (gfc_match_omp_map_clause): Re-write handling of the deviceptr clause. Add new common_blocks argument. Propagate it to gfc_match_omp_variable_list. (gfc_match_omp_clauses): Update calls to gfc_match_omp_map_clauses. (resolve_positive_int_expr): Promote the warning to an error. (check_array_not_assumed): Remove pointer check. (resolve_oacc_nested_loops): Error on do concurrent loops. * trans-openmp.cc (gfc_omp_finish_clause): Don't create pointer data mappings for deviceptr clauses. (gfc_trans_omp_clauses): Likewise. gcc/ * gimplify.cc (enum gimplify_omp_var_data): Add GOVD_DEVICETPR. (oacc_default_clause): Privatize fortran common blocks. (omp_notice_variable): Add GOVD_DEVICEPTR attribute when appropriate. Defer the expansion of DECL_VALUE_EXPR for common block decls. (gimplify_scan_omp_clauses): Add GOVD_DEVICEPTR attribute when appropriate. (gimplify_adjust_omp_clauses_1): Set GOMP_MAP_FORCE_DEVICEPTR for implicit deviceptr mappings. gcc/testsuite/ * c-c++-common/goacc/deviceptr-4.c: Update. * gfortran.dg/goacc/loop-2-kernels-tile.f95: Update. * gfortran.dg/goacc/loop-2-parallel-tile.f95: Update. * gfortran.dg/goacc/sie.f95: Update. * gfortran.dg/goacc/tile-1.f90: Update. * gfortran.dg/gomp/pr77516.f90: Update. libgomp/ * oacc-parallel.c (GOACC_parallel_keyed): Handle Fortran deviceptr clause. (GOACC_data_start): Likewise. * testsuite/libgomp.oacc-fortran/deviceptr-1.f90: New test.
2022-06-21Merge non-contiguous array support patches.Chung-Lin Tang16-24/+487
This version is based from v4, posted upstream here: https://gcc.gnu.org/pipermail/gcc-patches/2020-April/543437.html 2020-04-19 Chung-Lin Tang <cltang@codesourcery.com> PR other/76739 gcc/c/ * c-typeck.cc (handle_omp_array_sections_1): Add 'bool &non_contiguous' parameter, adjust recursive call site, add cases for allowing pointer based multi-dimensional arrays for OpenACC. (handle_omp_array_sections): Adjust handle_omp_array_sections_1 call, handle non-contiguous case to create dynamic array map. gcc/cp/ * semantics.cc (handle_omp_array_sections_1): Add 'bool &non_contiguous' parameter, adjust recursive call site, add cases for allowing pointer based multi-dimensional arrays for OpenACC. (handle_omp_array_sections): Adjust handle_omp_array_sections_1 call, handle non-contiguous case to create dynamic array map. gcc/fortran/ * f95-lang.cc (DEF_FUNCTION_TYPE_VAR_5): New symbol. * types.def (BT_FN_VOID_INT_SIZE_PTR_PTR_PTR_VAR): New type. gcc/ * builtin-types.def (BT_FN_VOID_INT_SIZE_PTR_PTR_PTR_VAR): New type. * omp-builtins.def (BUILT_IN_GOACC_DATA_START): Adjust function type to new BT_FN_VOID_INT_SIZE_PTR_PTR_PTR_VAR. * gimplify.cc (gimplify_scan_omp_clauses): Skip gimplification of OMP_CLAUSE_SIZE of non-contiguous array maps (which is a TREE_LIST). * omp-expand.cc (expand_omp_target): Add non-contiguous array descriptor pointers to variadic arguments. * omp-low.cc (append_field_to_record_type): New function. (create_noncontig_array_descr_type): Likewise. (create_noncontig_array_descr_init_code): Likewise. (scan_sharing_clauses): For non-contiguous array map kinds, check for supported dimension structure, and install non-contiguous array variable into current omp_context. (reorder_noncontig_array_clauses): New function. (scan_omp_target): Call reorder_noncontig_array_clauses to place non-contiguous array map clauses at beginning of clause sequence. (lower_omp_target): Add handling for non-contiguous array map kinds, add all created non-contiguous array descriptors to gimple_omp_target_data_arg. gcc/testsuite/ * c-c++-common/goacc/noncontig_array-1.c: New test. libgomp/ * libgomp_g.h (GOACC_data_start): Add variadic '...' to declaration. * libgomp.h (gomp_map_vars_openacc): New function declaration. * oacc-int.h (struct goacc_ncarray_dim): New struct declaration. (struct goacc_ncarray_descr_type): Likewise. (struct goacc_ncarray): Likewise. (struct goacc_ncarray_info): Likewise. (goacc_noncontig_array_create_ptrblock): New function declaration. * oacc-parallel.c (goacc_noncontig_array_count_rows): New function. (goacc_noncontig_array_compute_sizes): Likewise. (goacc_noncontig_array_fill_rows_1): Likewise. (goacc_noncontig_array_fill_rows): Likewise. (goacc_process_noncontiguous_arrays): Likewise. (goacc_noncontig_array_create_ptrblock): Likewise. (GOACC_parallel_keyed): Use goacc_process_noncontiguous_arrays to handle non-contiguous array descriptors at end of varargs, adjust to use gomp_map_vars_openacc. (GOACC_data_start): Likewise. Adjust function type to accept varargs. * target.c (gomp_map_vars_internal): Add struct goacc_ncarray_info * nca_info parameter, add handling code for non-contiguous arrays. (gomp_map_vars_openacc): Add new function for specialization of gomp_map_vars_internal for OpenACC structured region usage. * testsuite/libgomp.oacc-c-c++-common/noncontig_array-1.c: New test. * testsuite/libgomp.oacc-c-c++-common/noncontig_array-2.c: New test. * testsuite/libgomp.oacc-c-c++-common/noncontig_array-3.c: New test. * testsuite/libgomp.oacc-c-c++-common/noncontig_array-4.c: New test. * testsuite/libgomp.oacc-c-c++-common/noncontig_array-utils.h: Support header for new tests. include/ * gomp-constants.h (GOMP_MAP_FLAG_SPECIAL_3): Define. (enum gomp_map_kind): Add GOMP_MAP_NONCONTIG_ARRAY, GOMP_MAP_NONCONTIG_ARRAY_TO, GOMP_MAP_NONCONTIG_ARRAY_FROM, GOMP_MAP_NONCONTIG_ARRAY_TOFROM, GOMP_MAP_NONCONTIG_ARRAY_FORCE_TO, GOMP_MAP_NONCONTIG_ARRAY_FORCE_FROM, GOMP_MAP_NONCONTIG_ARRAY_FORCE_TOFROM, GOMP_MAP_NONCONTIG_ARRAY_ALLOC, GOMP_MAP_NONCONTIG_ARRAY_FORCE_ALLOC, GOMP_MAP_NONCONTIG_ARRAY_FORCE_PRESENT. (GOMP_MAP_NONCONTIG_ARRAY_P): Define.
2022-06-21Identify OMP development branch in output of 'gcc --version'Kwok Cheung Yeung2-1/+5
2022-06-20 Kwok Cheung Yeung <kcy@codesourcery.com> gcc/ * Makefile.in (REVISION_s): Change default message.
2022-06-21Daily bump.GCC Administrator3-1/+39
2022-06-20alpha: Introduce target specific store_data_bypass_p function [PR105209]Uros Bizjak4-11/+101
This patch introduces alpha-specific version of store_data_bypass_p that ignores TRAP_IF that would result in assertion failure (and internal compiler error) in the generic store_data_bypass_p function. While at it, also remove ev4_ist_c reservation, store_data_bypass_p can handle the patterns with multiple sets since some time ago. 2022-06-17 Uroš Bizjak <ubizjak@gmail.com> gcc/ChangeLog: PR target/105209 * config/alpha/alpha-protos.h (alpha_store_data_bypass_p): New. * config/alpha/alpha.cc (alpha_store_data_bypass_p): New function. (alpha_store_data_bypass_p_1): Ditto. * config/alpha/ev4.md: Use alpha_store_data_bypass_p instead of generic store_data_bypass_p. (ev4_ist_c): Remove insn reservation. gcc/testsuite/ChangeLog: PR target/105209 * gcc.target/alpha/pr105209.c: New test. (cherry picked from commit cc378e655740e93743e7f43e14faaff707aef6c1)
2022-06-20i386: Fix assert in ix86_function_arg [PR105970]Uros Bizjak2-1/+7
The mode of pointer argument should equal ptr_mode, not Pmode. 2022-06-17 Uroš Bizjak <ubizjak@gmail.com> gcc/ChangeLog: PR target/105970 * config/i386/i386.cc (ix86_function_arg): Assert that the mode of pointer argumet is equal to ptr_mode, not Pmode. gcc/testsuite/ChangeLog: PR target/105970 * gcc.target/i386/pr105970.c: New test. (cherry picked from commit 1f8278bfcfc7f7157bf2b405471e67dd5097636b)
2022-06-20Daily bump.GCC Administrator4-1/+98
2022-06-19varasm: Fix up ICE in narrowing_initializer_constant_valid_p [PR105998]Jakub Jelinek2-2/+20
The following testcase ICEs because there is NON_LVALUE_EXPR (location wrapper) around a VAR_DECL and has TYPE_MODE V2SImode and SCALAR_INT_TYPE_MODE on that ICEs. Or for -m32 -march=i386 TYPE_MODE is DImode, but SCALAR_INT_TYPE_MODE still uses the raw V2SImode and ICEs too. 2022-06-18 Jakub Jelinek <jakub@redhat.com> PR middle-end/105998 * varasm.cc (narrowing_initializer_constant_valid_p): Check SCALAR_INT_MODE_P instead of INTEGRAL_MODE_P, also break on ! INTEGRAL_TYPE_P and do the same check also on op{0,1}'s type. * c-c++-common/pr105998.c: New test. (cherry picked from commit ef662120177d39af5f88ffc622d90bb6ae0ca1d3)
2022-06-19c++: Use fold_non_dependent_expr rather than maybe_constant_value in ↵Jakub Jelinek2-1/+19
__builtin_shufflevector handling [PR106001] In this case the STATIC_CAST_EXPR expressions in the call aren't type nor value dependent, but maybe_constant_value still ICEs on those when processing_template_decl. Calling fold_non_dependent_expr on it instead fixes the ICE and folds them to INTEGER_CSTs. 2022-06-17 Jakub Jelinek <jakub@redhat.com> PR c++/106001 * typeck.cc (build_x_shufflevector): Use fold_non_dependent_expr instead of maybe_constant_value. * g++.dg/ext/builtin-shufflevector-4.C: New test. (cherry picked from commit a284fadcce8ef443cc3cc047a8017745efb51758)
2022-06-19expand: Fix up IFN_ATOMIC_{BIT*,*CMP_0} expansion [PR105951]Jakub Jelinek4-16/+64
Both IFN_ATOMIC_BIT_TEST_AND_* and IFN_ATOMIC_*_FETCH_CMP_0 ifns are matched if their corresponding optab is implemented for the particular mode. The fact that those optabs are implemented doesn't guarantee they will succeed though, they can just FAIL in their expansion. The expansion in that case uses expand_atomic_fetch_op as fallback, but as has been reported and and can be reproduced on the testcases, even those can fail and we didn't have any fallback after that. For IFN_ATOMIC_BIT_TEST_AND_* we actually have such calls. One is done whenever we lost lhs of the ifn at some point in between matching it in tree-ssa-ccp.cc and expansion. The following patch for that case just falls through and expands as if there was a lhs, creates a temporary for it. For the other expand_atomic_fetch_op call in the same expander and for the only expand_atomic_fetch_op call in the other, this falls back the hard way, by constructing a CALL_EXPR to the call from which the ifn has been matched and expanding that. Either it is lucky and manages to expand inline, or it emits a libatomic API call. So that we don't have to rediscover which builtin function to call in the fallback, we record at tree-ssa-ccp.cc time gimple_call_fn (call) in an extra argument to the ifn. 2022-06-16 Jakub Jelinek <jakub@redhat.com> PR middle-end/105951 * tree-ssa-ccp.cc (optimize_atomic_bit_test_and, optimize_atomic_op_fetch_cmp_0): Remember gimple_call_fn (call) as last argument to the internal functions. * builtins.cc (expand_ifn_atomic_bit_test_and): Adjust for the extra call argument to ifns. If expand_atomic_fetch_op fails for the lhs == NULL_TREE case, fall through into the optab code with gen_reg_rtx (mode) as target. If second expand_atomic_fetch_op fails, construct a CALL_EXPR and expand that. (expand_ifn_atomic_op_fetch_cmp_0): Adjust for the extra call argument to ifns. If expand_atomic_fetch_op fails, construct a CALL_EXPR and expand that. * gcc.target/i386/pr105951-1.c: New test. * gcc.target/i386/pr105951-2.c: New test. (cherry picked from commit 6a27c430468cb85454b19cef881a1422580657ff)
2022-06-19Fix ipa-cp wrt volatile loadsJan Hubicka2-0/+34
Check for volatile flag to ipa_load_from_parm_agg. gcc/ChangeLog: 2022-06-10 Jan Hubicka <hubicka@ucw.cz> PR ipa/105739 * ipa-prop.cc (ipa_load_from_parm_agg): Punt on volatile loads. gcc/testsuite/ChangeLog: 2022-06-10 Jan Hubicka <hubicka@ucw.cz> * gcc.dg/ipa/pr105739.c: New test. (cherry picked from commit 8f6c317b3a16350698f3c9e0accb43a9b4acb4ae)
2022-06-19c++: Fix up ICE on __builtin_shufflevector constexpr evaluation [PR105871]Jakub Jelinek2-3/+22
As the following testcase shows, BIT_FIELD_REF result doesn't have to have just integral type, it can also have vector type. And in that case cxx_eval_bit_field_ref just ICEs on it because it is unprepared for that case, creates the initial value with build_int_cst (sure, that one could be easily replaced with build_zero_cst) and then expects it can through shifts, ands and ors come up with the final value, but that doesn't work for vectors. We already call fold_ternary if whole is a VECTOR_CST, this patch does the same if the result doesn't have integral type. And, there is no guarantee fold_ternary will succeed and the callers certainly don't expect NULL being returned, so it also diagnoses those as non-constant and returns original t in that case. 2022-06-09 Jakub Jelinek <jakub@redhat.com> PR c++/105871 * constexpr.cc (cxx_eval_bit_field_ref): For BIT_FIELD_REF with non-integral result type use fold_ternary too like for BIT_FIELD_REFs from VECTOR_CST. If fold_ternary returns NULL, diagnose non-constant expression, set *non_constant_p and return t, instead of returning NULL. * g++.dg/pr105871.C: New test. (cherry picked from commit 4c334e0e4ff05d3a7ca9ebb832428c446cd0ae8d)
2022-06-19Daily bump.GCC Administrator1-1/+1
2022-06-18Daily bump.GCC Administrator1-1/+1
2022-06-17Daily bump.GCC Administrator2-1/+11
2022-06-16arm: big-endian issue in gen_cpymem_ldrd_strd [PR105981]Richard Earnshaw1-8/+16
The code in gen_cpymem_ldrd_strd has been incorrect for big-endian since r230663. The problem is that we use gen_lowpart, etc. to split the 64-bit quantity, but fail to account for the fact that these routines are really dealing with 64-bit /values/ and in big-endian the ordering of the sub-registers changes. To fix this, I've renamed the conceptually misnamed low_reg and hi_reg as first_reg and second_reg, and then used different logic for big-endian targets to initialize these values. This makes the logic clearer than trying to think about high bits and low bits. gcc/ChangeLog: PR target/105981 * config/arm/arm.cc (gen_cpymem_ldrd_strd): Rename low_reg and hi_reg to first_reg and second_reg respectively. Initialize them correctly when generating big-endian code. (cherry picked from commit 8aaa948059a8b5f0a62ad010d0aa6346b7ac9cd3)
2022-06-16Daily bump.GCC Administrator4-1/+51
2022-06-15Darwin: Truncate kernel-provided version to OS major for Darwin >= 20.Simon Wright1-11/+5
In common with system tools, GCC uses a version obtained from the kernel as the prevailing macOS target, when that is not overridden by command line or environment versions (i.e. mmacosx-version-min=, MACOSX_DEPLOYMENT_TARGET). Presently, GCC assumes that if the OS version is >= 20, the value used should include both major and minium version identifiers. However the system tools (for those versions) truncate the value to the major version - this leads to link errors when combining objects built with clang and GCC for example: ld: warning: object file (null.o) was built for newer macOS version (12.2) than being linked (12.0) The change here truncates the values GCC uses to the major version. gcc/ChangeLog: PR target/104871 * config/darwin-driver.cc (darwin_find_version_from_kernel): If the OS version is darwin20 (macOS 11) or greater, truncate the version to the major number. (cherry picked from commit add1adaa17a294ea25918ffb4fdd40f115362632)
2022-06-15Darwin: Future-proof -mmacosx-version-minMark Mentovai1-1/+2
f18cbc1ee1f4 (2021-12-18) updated various parts of gcc to not impose a Darwin or macOS version maximum of the current known release. Different parts of gcc accept, variously, Darwin version numbers matching darwin2*, and macOS major version numbers up to 99. The current released version is Darwin 21 and macOS 12, with Darwin 22 and macOS 13 expected for public release later this year. With one major OS release per year, this strategy is expected to provide another 8 years of headroom. However, f18cbc1ee1f4 missed config/darwin-c.c (now .cc), which continued to impose a maximum of macOS 12 on the -mmacosx-version-min compiler driver argument. This was last updated from 11 to 12 in 11b967577483 (2021-10-27), but kicking the can down the road one year at a time is not a viable strategy, and is not in line with the more recent technique from f18cbc1ee1f4. Prior to 556ab5125912 (2020-11-06), config/darwin-c.c did not impose a maximum that needed annual maintenance, as at that point, all macOS releases had used a major version of 10. The stricter approach imposed since then was valuable for a time until the particulars of the new versioning scheme were established and understood, but now that they are, it's prudent to restore a more permissive approach. gcc/ChangeLog: * config/darwin-c.cc: Make -mmacosx-version-min more future-proof. Signed-off-by: Mark Mentovai <mark@mentovai.com> (cherry picked from commit 6725f186cb70d48338f69456864bf469a12ee5be)
2022-06-15Darwin: Fix empty g++ command lines [PR105599].Iain Sandoe1-11/+6
An empty g++ command line should produce a diagnostic that there are no inputs. The PR is that currently Darwin produces a dignostic about missing link items instead - this is because (errnoeously), for this driver, we are creating a link job for empty command lines. The problem occurs in four stages: The g++ driver appends -shared-libgcc to the command line. The Darwin driver_init code in the backend does not see this (it sees an empty command line). When the back end driver code driver sees an empty command line, it does not add any supplementary flags (e.g. asm-macosx-version-min) - precisely to avoid anything being claimed as an input_file and therefore triggering a link line. Since we do not have a value for asm-macosx-version-min when processing the driver specs, we unconditionally inject 'multiply_defined suppress' which is used with shared libgcc (but only intended on very old Darwin). This then causes the generation of a link job. The solution, for the present, is to move version-specific link params to the LINK_SPEC so that they are only processed when a link job has already been decided. Signed-off-by: Iain Sandoe <iain@sandoe.co.uk> PR target/105599 gcc/ChangeLog: * config/darwin.h: Move versions-specific handling of multiply_defined from SUBTARGET_DRIVER_SELF_SPECS to LINK_SPEC. (cherry picked from commit 794737976b9a6418eab817f143bb4eb2d0c834d2)
2022-06-15d: Set TYPE_ARTIFICIAL on internal TypeInfo typesIain Buclaw2-0/+5
Prevents them from triggering warnings when compiling with `-Wpadded'. gcc/d/ChangeLog: * typeinfo.cc (make_internal_typeinfo): Set TYPE_ARTIFICIAL. gcc/testsuite/ChangeLog: * gdc.dg/Wpadded.d: New test. (cherry picked from commit 57b2adae536a6399ed7d2c881b1bc0d4b88e936a)
2022-06-15Fix ICE in extract_insn, at recog.cc:2791liuhongt2-2/+5
(In reply to Uroš Bizjak from comment #1) > Instruction does not accept memory operand for operand 3: > > (define_insn_and_split > "*<sse4_1>_blendv<ssefltmodesuffix><avxsizesuffix>_ltint" > [(set (match_operand:<ssebytemode> 0 "register_operand" "=Yr,*x,x") > (unspec:<ssebytemode> > [(match_operand:<ssebytemode> 1 "register_operand" "0,0,x") > (match_operand:<ssebytemode> 2 "vector_operand" "YrBm,*xBm,xm") > (subreg:<ssebytemode> > (lt:VI48_AVX > (match_operand:VI48_AVX 3 "register_operand" "Yz,Yz,x") > (match_operand:VI48_AVX 4 "const0_operand")) 0)] > UNSPEC_BLENDV))] > > The problematic insn is: > > (define_insn_and_split "*avx_cmp<mode>3_ltint_not" > [(set (match_operand:VI48_AVX 0 "register_operand") > (vec_merge:VI48_AVX > (match_operand:VI48_AVX 1 "vector_operand") > (match_operand:VI48_AVX 2 "vector_operand") > (unspec:<avx512fmaskmode> > [(subreg:VI48_AVX > (not:<ssebytemode> > (match_operand:<ssebytemode> 3 "vector_operand")) 0) > (match_operand:VI48_AVX 4 "const0_operand") > (match_operand:SI 5 "const_0_to_7_operand")] > UNSPEC_PCMP)))] > > which gets split to the above pattern. > > In the preparation statements we have: > > if (!MEM_P (operands[3])) > operands[3] = force_reg (<ssebytemode>mode, operands[3]); > operands[3] = lowpart_subreg (<MODE>mode, operands[3], <ssebytemode>mode); > > Which won't fly when operand 3 is memory operand... > gcc/ChangeLog: PR target/105953 * config/i386/sse.md (*avx_cmp<mode>3_ltint_not): Force_reg operands[3]. gcc/testsuite/ChangeLog: * g++.target/i386/pr105953.C: New test.
2022-06-15Daily bump.GCC Administrator2-1/+21
2022-06-14x86: Require AVX for F16C and VAESH.J. Lu1-4/+4
Since F16C and VAES are only usable with AVX, require AVX for F16C and VAES. libgcc/105920 * common/config/i386/cpuinfo.h (get_available_features): Require AVX for F16C and VAES. (cherry picked from commit 751f306688508b08842d0ab967dee8e6c3b91351)
2022-06-14RISC-V: bitmanip: improve constant-loading for (1ULL << 31) in DImodePhilipp Tomsich2-7/+13
The SINGLE_BIT_MASK_OPERAND() is overly restrictive, triggering for bits above 31 only (to side-step any issues with the negative SImode value 0x80000000/(-1ull << 31)/(1 << 31)). This moves the special handling of this SImode value (i.e. the check for (-1ull << 31) to riscv.cc and relaxes the SINGLE_BIT_MASK_OPERAND() test. With this, the code-generation for loading (1ULL << 31) from: li a0,1 slli a0,a0,31 to: bseti a0,zero,31 gcc/ChangeLog: * config/riscv/riscv.cc (riscv_build_integer_1): Rewrite value as (-1 << 31) for the single-bit case, when operating on (1 << 31) in SImode. * config/riscv/riscv.h (SINGLE_BIT_MASK_OPERAND): Allow for any single-bit value, moving the special case for (1 << 31) to riscv_build_integer_1 (in riscv.c). Signed-off-by: Philipp Tomsich <philipp.tomsich@vrull.eu> (cherry picked from commit 4e72ccad80d69a76d149fba59603b8173fffe8fe)
2022-06-14Daily bump.GCC Administrator3-1/+20
2022-06-13d: Improve TypeInfo errors when compiling in -fno-rtti modeIain Buclaw4-30/+63
The existing TypeInfo errors can be cryptic. This alters the diagnostic to include which expression is requiring `object.TypeInfo'. gcc/d/ChangeLog: * d-tree.h (check_typeinfo_type): Add Expression* parameter. (build_typeinfo): Likewise. Declare new override. * expr.cc (ExprVisitor): Call build_typeinfo with Expression*. * typeinfo.cc (check_typeinfo_type): Include expression in the diagnostic message. (build_typeinfo): New override. gcc/testsuite/ChangeLog: * gdc.dg/rtti1.d: New test. (cherry picked from commit e55eda238545e93708c020fd21249459be64c463)