aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2022-11-03tree-cfg: Fix a verification diagnostic typo [PR107121]Jakub Jelinek1-1/+1
Obvious typo in diagnostics. 2022-10-02 Jakub Jelinek <jakub@redhat.com> PR tree-optimization/107121 * tree-cfg.cc (verify_gimple_call): Fix a typo in diagnostics, DEFFERED_INIT -> DEFERRED_INIT. (cherry picked from commit d01bd0b0f3b8f4c33c437ff10f0b949200627f56)
2022-11-03openmp: Fix ICE with taskgroup at -O0 -fexceptions [PR107001]Jakub Jelinek3-3/+29
The following testcase ICEs because with -O0 -fexceptions GOMP_taskgroup_end call isn't directly followed by GOMP_RETURN statement, but there are some conditionals to handle exceptions and we fail to find the correct GOMP_RETURN. The fix is to treat taskgroup similarly to target data, both of these constructs emit a try { body } finally { end_call } around the construct's body during gimplification and we need to see proper construct nesting during gimplification and omp lowering (including nesting of regions checks), but during omp expansion we don't really need their nesting anymore, all we need is emit something at the start of the region and the end of the region is the end API call we've already emitted during gimplification. For target data, we weren't adding GOMP_RETURN statement during omp lowering, so after that pass it is treated merely like stand-alone omp directives. This patch does the same for taskgroup too. 2022-09-24 Jakub Jelinek <jakub@redhat.com> PR c/107001 * omp-low.cc (lower_omp_taskgroup): Don't add GOMP_RETURN statement at the end. * omp-expand.cc (build_omp_regions_1): Clarify GF_OMP_TARGET_KIND_DATA is not stand-alone directive. For GIMPLE_OMP_TASKGROUP, also don't update parent. (omp_make_gimple_edges) <case GIMPLE_OMP_TASKGROUP>: Reset cur_region back after new_omp_region. * c-c++-common/gomp/pr107001.c: New test. (cherry picked from commit ad2aab5c816a6fd56b46210c0a4a4c6243da1de9)
2022-11-03openmp, c: Tighten up c_tree_equal [PR106981]Jakub Jelinek3-6/+38
This patch changes c_tree_equal to work more like cp_tree_equal, be more strict in what it accepts. The ICE on the first testcase was due to INTEGER_CST wi::wide (t1) == wi::wide (t2) comparison which ICEs if the two constants have different precision, but as the second testcase shows, being too lenient in it can also lead to miscompilation of valid OpenMP programs where we think certain expression is the same even when it isn't and can be guaranteed at runtime to represent different memory location. So, the patch looks through only NON_LVALUE_EXPRs and for constants as well as casts requires that the types match before actually comparing the constant values or recursing on the cast operands. 2022-09-24 Jakub Jelinek <jakub@redhat.com> PR c/106981 gcc/c/ * c-typeck.cc (c_tree_equal): Only strip NON_LVALUE_EXPRs at the start. For CONSTANT_CLASS_P or CASE_CONVERT: return false if t1 and t2 have different types. gcc/testsuite/ * c-c++-common/gomp/pr106981.c: New test. libgomp/ * testsuite/libgomp.c-c++-common/pr106981.c: New test. (cherry picked from commit 3c5bccb608c665ac3f62adb1817c42c845812428)
2022-11-03openmp: Fix handling of target constructs in static member functions [PR106829]Jakub Jelinek2-9/+23
Just calling current_nonlambda_class_type in static member functions returns non-NULL, but something that isn't *this and if unlucky can match part of the IL and can be added to target clauses. if (DECL_NONSTATIC_MEMBER_P (decl) && current_class_ptr) is a guard used elsewhere (in check_accessibility_of_qualified_id). 2022-09-07 Jakub Jelinek <jakub@redhat.com> PR c++/106829 * semantics.cc (finish_omp_target_clauses): If current_function_decl isn't a nonstatic member function, don't set data.current_object to non-NULL. * g++.dg/gomp/pr106829.C: New test. (cherry picked from commit e90af965e5c858ba02c0cdfbac35d0a19da1c2f6)
2022-11-03Daily bump.GCC Administrator1-1/+1
2022-11-02Fortran "declare create"/allocate support for OpenACC: adjust ↵Thomas Schwinge4-61/+499
'libgomp.oacc-fortran/declare-allocatable-array_descriptor-1*.f90' libgomp/ * testsuite/libgomp.oacc-fortran/declare-allocatable-array_descriptor-1-directive.f90: Adjust. * testsuite/libgomp.oacc-fortran/declare-allocatable-array_descriptor-1-runtime.f90: Likewise. * testsuite/libgomp.oacc-fortran/declare-allocatable-array_descriptor-1.f90: New.
2022-11-02Fortran "declare create"/allocate support for OpenACC: adjust ↵Thomas Schwinge4-12/+14
'libgomp.oacc-fortran/declare-allocatable-1*.f90' libgomp/ * testsuite/libgomp.oacc-fortran/declare-allocatable-1-directive.f90: Adjust. * testsuite/libgomp.oacc-fortran/declare-allocatable-1-runtime.f90: Likewise. * testsuite/libgomp.oacc-fortran/declare-allocatable-1.f90: Likewise.
2022-11-02XFAIL some OpenACC 'kernels' confusion in ↵Thomas Schwinge4-0/+37
'libgomp.oacc-fortran/declare-allocatable-1*.f90' Seen only for certain optimizations levels, as indicated; so there are a few XPASSes otherwise. There are neither OpenACC 'kernels' constructs here, nor other 'loop' constructs with 'auto' clause, so I'm not sure what's going on. libgomp/ * testsuite/libgomp.oacc-fortran/declare-allocatable-1-directive.f90: XFAIL some OpenACC 'kernels' confusion. * testsuite/libgomp.oacc-fortran/declare-allocatable-1-runtime.f90: Likewise. * testsuite/libgomp.oacc-fortran/declare-allocatable-1.f90: Likewise.
2022-11-02Support OpenACC 'declare create' with Fortran allocatable arrays, part II ↵Thomas Schwinge4-28/+171
[PR106643, PR96668] PR libgomp/106643 PR fortran/96668 libgomp/ * oacc-mem.c (goacc_enter_data_internal): Support OpenACC 'declare create' with Fortran allocatable arrays, part II. * testsuite/libgomp.oacc-fortran/declare-allocatable-array_descriptor-1-directive.f90: Adjust. * testsuite/libgomp.oacc-fortran/pr106643-1.f90: New. (cherry picked from commit f6ce1e77bbf5d3a096f52e674bfd7354c6537d10)
2022-11-02Support OpenACC 'declare create' with Fortran allocatable arrays, part I ↵Thomas Schwinge4-2/+717
[PR106643] PR libgomp/106643 libgomp/ * oacc-mem.c (goacc_enter_data_internal): Support OpenACC 'declare create' with Fortran allocatable arrays, part I. * testsuite/libgomp.oacc-fortran/declare-allocatable-1-directive.f90: New. * testsuite/libgomp.oacc-fortran/declare-allocatable-array_descriptor-1-directive.f90: New. (cherry picked from commit da8e0e1191c5512244a752b30dea0eba83e3d10c)
2022-11-02Add 'libgomp.oacc-fortran/declare-allocatable-array_descriptor-1-runtime.f90'Thomas Schwinge2-0/+408
libgomp/ * testsuite/libgomp.oacc-fortran/declare-allocatable-array_descriptor-1-runtime.f90: New. (cherry picked from commit abeaf3735fe2568b9d5b8096318da866b1fe1e5c)
2022-11-02Add 'libgomp.oacc-fortran/declare-allocatable-1-runtime.f90'Thomas Schwinge2-0/+284
... which is 'libgomp.oacc-fortran/declare-allocatable-1.f90' adjusted for missing support for OpenACC "Changes from Version 2.0 to 2.5": "The 'declare create' directive with a Fortran 'allocatable' has new behavior". Thus, after 'allocate'/before 'deallocate', call 'acc_create'/'acc_delete' manually. libgomp/ * testsuite/libgomp.oacc-fortran/declare-allocatable-1-runtime.f90: New. (cherry picked from commit 59c6c5dbf267cd9d0a8df72b2a5eb5657b64268e)
2022-11-02Add 'libgomp.oacc-fortran/declare-allocatable-1.f90'Cesar Philippidis2-34/+98
libgomp/ * testsuite/libgomp.oacc-fortran/declare-allocatable-1.f90: New. Co-authored-by: Thomas Schwinge <thomas@codesourcery.com> (cherry picked from commit 8c357d884b16cb3c14cba8a61be5b53fd04a6bfe)
2022-11-02Fortran/OpenMP: Fix DT struct-component with 'alloc' and array descrTobias Burnus4-1/+578
When using 'map(alloc: var, dt%comp)' needs to have a 'to' mapping of the array descriptor as otherwise the bounds are not available in the target region. - Likewise for character strings. This patch implements this; however, some additional issues are exposed by the testcase; those are '#if 0'ed and will be handled later. Submitted to mainline (but pending review): https://gcc.gnu.org/pipermail/gcc-patches/2022-November/604887.html gcc/fortran/ChangeLog: * trans-openmp.cc (gfc_trans_omp_clauses): Ensure DT struct-comp with array descriptor and 'alloc:' have the descriptor mapped with 'to:'. libgomp/ChangeLog: * testsuite/libgomp.fortran/target-enter-data-3.f90: New test.
2022-11-02libgomp.c-c++-common/requires-4.c: Fix dg-xfail-run-if conditionTobias Burnus2-1/+6
Seemingly an extra { } is required. This is a follow up to OG12 commit 0c47ae1c9283a812f832e80e451bfa82519c21e8 libgomp/ * testsuite/libgomp.c-c++-common/requires-4.c: Fix dg-xfail-run-if condition.
2022-11-02OpenMP/Fortran: 'target update' with strides + DT componentsTobias Burnus6-9/+269
OpenMP 5.0 permits to use arrays with strides and derived type components for the list items to the 'from'/'to' clauses of the 'target update' directive. Submitted to mainline (but pending review): https://gcc.gnu.org/pipermail/gcc-patches/2022-October/604687.html gcc/fortran/ChangeLog: * openmp.cc (gfc_match_omp_clauses): Permit derived types. (resolve_omp_clauses):Accept noncontiguous arrays. * trans-openmp.cc (gfc_trans_omp_clauses): Fixes for derived-type changes; fix size for scalars. libgomp/ChangeLog: * testsuite/libgomp.fortran/target-11.f90: New test. * testsuite/libgomp.fortran/target-13.f90: New test.
2022-11-02Merge branch 'releases/gcc-12' into devel/omp/gcc-12Tobias Burnus12-2/+220
Merge up to r12-8881-gb80a690673272919896ee5939250e50d882f2418 (2nd Nov 2022)
2022-11-02amdgcn: Enable SIMD vectorization of math functionsKwok Cheung Yeung7-0/+560
Calls to vectorized versions of routines in the math library will now be inserted when vectorizing code containing supported math functions. 2022-11-01 Kwok Cheung Yeung <kcy@codesourcery.com> Paul-Antoine Arras <pa@codesourcery.com> gcc/ * builtins.cc (mathfn_built_in_explicit): New. * config/gcn/gcn.cc: Include case-cfn-macros.h. (mathfn_built_in_explicit): Add prototype. (gcn_vectorize_builtin_vectorized_function): New. (gcn_libc_has_function): New. (TARGET_VECTORIZE_BUILTIN_VECTORIZED_FUNCTION): Define. (TARGET_LIBC_HAS_FUNCTION): Define. gcc/testsuite/ * gcc.target/gcn/simd-math-1.c: New testcase. libgomp/ * testsuite/libgomp.c/simd-math-1.c: New testcase.
2022-11-02amdgcn: Add SIMD versions of math routines to libgccKwok Cheung Yeung92-0/+6223
These should eventually be moved into Newlib. 2022-11-01 Kwok Cheung Yeung <kcy@codesourcery.com> Paul-Antoine Arras <pa@codesourcery.com> Andrew Jenner <andrew@codesourcery.com> libgcc/ * config.host: Add t-simdmath for GCN if header files present. * config/gcn/simd-math/amdgcnmach.h: New. * config/gcn/simd-math/v64_mathcnst.c: New. * config/gcn/simd-math/v64_reent.c: New. * config/gcn/simd-math/v64df_acos.c: New. * config/gcn/simd-math/v64df_acosh.c: New. * config/gcn/simd-math/v64df_asin.c: New. * config/gcn/simd-math/v64df_asine.c: New. * config/gcn/simd-math/v64df_asinh.c: New. * config/gcn/simd-math/v64df_atan.c: New. * config/gcn/simd-math/v64df_atan2.c: New. * config/gcn/simd-math/v64df_atangent.c: New. * config/gcn/simd-math/v64df_atanh.c: New. * config/gcn/simd-math/v64df_copysign.c: New. * config/gcn/simd-math/v64df_cos.c: New. * config/gcn/simd-math/v64df_cosh.c: New. * config/gcn/simd-math/v64df_erf.c: New. * config/gcn/simd-math/v64df_exp.c: New. * config/gcn/simd-math/v64df_exp2.c: New. * config/gcn/simd-math/v64df_finite.c: New. * config/gcn/simd-math/v64df_fmod.c: New. * config/gcn/simd-math/v64df_gamma.c: New. * config/gcn/simd-math/v64df_hypot.c: New. * config/gcn/simd-math/v64df_ilogb.c: New. * config/gcn/simd-math/v64df_isnan.c: New. * config/gcn/simd-math/v64df_ispos.c: New. * config/gcn/simd-math/v64df_lgamma.c: New. * config/gcn/simd-math/v64df_lgamma_r.c: New. * config/gcn/simd-math/v64df_log.c: New. * config/gcn/simd-math/v64df_log10.c: New. * config/gcn/simd-math/v64df_log2.c: New. * config/gcn/simd-math/v64df_modf.c: New. * config/gcn/simd-math/v64df_numtest.c: New. * config/gcn/simd-math/v64df_pow.c: New. * config/gcn/simd-math/v64df_remainder.c: New. * config/gcn/simd-math/v64df_rint.c: New. * config/gcn/simd-math/v64df_scalb.c: New. * config/gcn/simd-math/v64df_scalbn.c: New. * config/gcn/simd-math/v64df_signif.c: New. * config/gcn/simd-math/v64df_sin.c: New. * config/gcn/simd-math/v64df_sine.c: New. * config/gcn/simd-math/v64df_sineh.c: New. * config/gcn/simd-math/v64df_sinh.c: New. * config/gcn/simd-math/v64df_sqrt.c: New. * config/gcn/simd-math/v64df_tan.c: New. * config/gcn/simd-math/v64df_tanh.c: New. * config/gcn/simd-math/v64df_tgamma.c: New. * config/gcn/simd-math/v64sf_acos.c: New. * config/gcn/simd-math/v64sf_acosh.c: New. * config/gcn/simd-math/v64sf_asin.c: New. * config/gcn/simd-math/v64sf_asine.c: New. * config/gcn/simd-math/v64sf_asinh.c: New. * config/gcn/simd-math/v64sf_atan.c: New. * config/gcn/simd-math/v64sf_atan2.c: New. * config/gcn/simd-math/v64sf_atangent.c: New. * config/gcn/simd-math/v64sf_atanh.c: New. * config/gcn/simd-math/v64sf_copysign.c: New. * config/gcn/simd-math/v64sf_cos.c: New. * config/gcn/simd-math/v64sf_cosh.c: New. * config/gcn/simd-math/v64sf_erf.c: New. * config/gcn/simd-math/v64sf_exp.c: New. * config/gcn/simd-math/v64sf_exp2.c: New. * config/gcn/simd-math/v64sf_finite.c: New. * config/gcn/simd-math/v64sf_fmod.c: New. * config/gcn/simd-math/v64sf_gamma.c: New. * config/gcn/simd-math/v64sf_hypot.c: New. * config/gcn/simd-math/v64sf_ilogb.c: New. * config/gcn/simd-math/v64sf_isnan.c: New. * config/gcn/simd-math/v64sf_ispos.c: New. * config/gcn/simd-math/v64sf_lgamma.c: New. * config/gcn/simd-math/v64sf_lgamma_r.c: New. * config/gcn/simd-math/v64sf_log.c: New. * config/gcn/simd-math/v64sf_log10.c: New. * config/gcn/simd-math/v64sf_log2.c: New. * config/gcn/simd-math/v64sf_modf.c: New. * config/gcn/simd-math/v64sf_numtest.c: New. * config/gcn/simd-math/v64sf_pow.c: New. * config/gcn/simd-math/v64sf_remainder.c: New. * config/gcn/simd-math/v64sf_rint.c: New. * config/gcn/simd-math/v64sf_scalb.c: New. * config/gcn/simd-math/v64sf_scalbn.c: New. * config/gcn/simd-math/v64sf_sin.c: New. * config/gcn/simd-math/v64sf_sine.c: New. * config/gcn/simd-math/v64sf_sineh.c: New. * config/gcn/simd-math/v64sf_sinh.c: New. * config/gcn/simd-math/v64sf_sqrt.c: New. * config/gcn/simd-math/v64sf_tan.c: New. * config/gcn/simd-math/v64sf_tanh.c: New. * config/gcn/simd-math/v64sf_tgamma.c: New. * config/gcn/t-simdmath: New.
2022-11-02Daily bump.GCC Administrator1-1/+1
2022-11-01amdgcn: Add builtins for vector floor/floorfKwok Cheung Yeung3-0/+39
2022-11-01 Kwok Cheung Yeung <kcy@codesourcery.com> gcc/ * config/gcn/gcn-builtins.def (FLOORVF): New builtin. (FLOORV): New builtin. * config/gcn/gcn.cc (gcn_expand_builtin_1): Expand GCN_BUILTIN_FLOORVF and GCN_BUILTIN_FLOORV.
2022-11-01amdgcn: Fix expansion of builtin for vector fabs operationKwok Cheung Yeung2-3/+6
2022-11-01 Kwok Cheung Yeung <kcy@codesourcery.com> * config/gcn/gcn.cc (gcn_expand_builtin_1): Fix expansion of GCN_BUILTIN_FABSV.
2022-11-01openmp: Bugfix in omp_expand_metadirective for same blocks/edges to be deleted.Marcel Vollweiler4-0/+26
This patch handles an ICE that is thrown in omp_expand_metadirective when a basic_block for a metadirective label is tried to be deleted multiple times. To avoid this situation, processed labels are added to the already existing list of labels that are not intended to be deleted. The issue occured in the attached test case. gcc/ChangeLog: * omp-expand-metadirective.cc (omp_expand_metadirective): Add already processed labels to "labels" (the list of labels not to be deleted). gcc/testsuite/ChangeLog: * c-c++-common/gomp/metadirective-8.c: New test.
2022-11-01amdgcn: add fmin/fmax patternsAndrew Stubbs3-0/+43
Add fmin/fmax for scalar, vector, and reductions. The smin/smax patterns are already using the IEEE compliant hardware instructions anyway, so we can just expand to use those insns. gcc/ChangeLog: * config/gcn/gcn-valu.md (fminmaxop): New iterator. (<fexpander><mode>3): New define_expand. (<fexpander><mode>3<exec>): Likewise. (reduc_<fexpander>_scal_<mode>): Likewise. * config/gcn/gcn.md (fexpander): New attribute. (cherry picked from commit 10aa0356118f44e5f4d720a2a4c731b173baa298)
2022-11-01amdgcn: multi-size vector reductionsAndrew Stubbs4-94/+69
Add support for vector reductions for any vector width by switching iterators and generalising the code slightly. There's no one-instruction way to move an item from lane 31 to lane 0 (63, 15, 7, 3, and 1 are all fine though), and vec_extract is probably fewer cycles anyway, so now we always reduce to an SGPR. gcc/ChangeLog: * config/gcn/gcn-valu.md (V64_SI): Delete iterator. (V64_DI): Likewise. (V64_1REG): Likewise. (V64_INT_1REG): Likewise. (V64_2REG): Likewise. (V64_ALL): Likewise. (V64_FP): Likewise. (reduc_<reduc_op>_scal_<mode>): Use V_ALL. Use gen_vec_extract. (fold_left_plus_<mode>): Use V_FP. (*<reduc_op>_dpp_shr_<mode>): Use V_1REG. (*<reduc_op>_dpp_shr_<mode>): Use V_DI. (*plus_carry_dpp_shr_<mode>): Use V_INT_1REG. (*plus_carry_in_dpp_shr_<mode>): Use V_SI. (*plus_carry_dpp_shr_<mode>): Use V_DI. (mov_from_lane63_<mode>): Delete. (mov_from_lane63_<mode>): Delete. * config/gcn/gcn.cc (gcn_expand_reduc_scalar): Support partial vectors. * config/gcn/gcn.md (unspec): Remove UNSPEC_MOV_FROM_LANE63. (cherry picked from commit f539029c1ce6fb9163422d1a8b6ac12a2554eaa2)
2022-11-01Daily bump.GCC Administrator1-1/+1
2022-10-31Daily bump.GCC Administrator1-1/+1
2022-10-30Daily bump.GCC Administrator3-1/+24
2022-10-29Fortran: Add missing TKR initialization to class variables [PR100097, PR100098]José Rui Faustino de Sousa5-1/+139
gcc/fortran/ChangeLog: PR fortran/100097 PR fortran/100098 * trans-array.cc (gfc_trans_class_array): New function to initialize class descriptor's TKR information. * trans-array.h (gfc_trans_class_array): Add function prototype. * trans-decl.cc (gfc_trans_deferred_vars): Add calls to the new function for both pointers and allocatables. gcc/testsuite/ChangeLog: PR fortran/100097 PR fortran/100098 * gfortran.dg/PR100097.f90: New test. * gfortran.dg/PR100098.f90: New test. (cherry picked from commit 4cfdaeb2755121ac1069f09898def56469b0fb51)
2022-10-29Daily bump.GCC Administrator5-1/+41
2022-10-28Fortran: BOZ literal constants are not compatible to any type [PR103413]Harald Anlauf2-0/+17
gcc/fortran/ChangeLog: PR fortran/103413 * symbol.cc (gfc_type_compatible): A boz-literal-constant has no type and thus is not considered compatible to any type. gcc/testsuite/ChangeLog: PR fortran/103413 * gfortran.dg/illegal_boz_arg_4.f90: New test. (cherry picked from commit f7d28818179247685f3c101f9f2f16366f56309b)
2022-10-28openmp: Allow optional comma after directive-specifier in C/C++Jakub Jelinek10-89/+728
Previously we've been allowing that comma only in C++ when in attribute form (which was the reason why it has been allowed), but 5.1 allows that even in pragma form in C/C++ (with clarifications in 5.2) and 5.2 also in Fortran (which this patch doesn't implement). Note, for directives which take an argument (== unnamed clause), comma is not allowed in between the directive name and the argument, like the directive-1.c testcase shows. 2022-10-28 Jakub Jelinek <jakub@redhat.com> gcc/c/ * c-parser.cc (c_parser_omp_all_clauses): Allow optional comma before the first clause. (c_parser_omp_allocate, c_parser_omp_atomic, c_parser_omp_depobj, c_parser_omp_flush, c_parser_omp_scan_loop_body, c_parser_omp_ordered, c_finish_omp_declare_variant, c_parser_omp_declare_target, c_parser_omp_declare_reduction, c_parser_omp_requires, c_parser_omp_error, c_parser_omp_assumption_clauses): Likewise. gcc/cp/ * parser.cc (cp_parser_omp_all_clauses): Allow optional comma before the first clause even in pragma syntax. (cp_parser_omp_allocate, cp_parser_omp_atomic, cp_parser_omp_depobj, cp_parser_omp_flush, cp_parser_omp_scan_loop_body, cp_parser_omp_ordered, cp_parser_omp_assumption_clauses, cp_finish_omp_declare_variant, cp_parser_omp_declare_target, cp_parser_omp_declare_reduction_exprs, cp_parser_omp_requires, cp_parser_omp_error): Likewise. gcc/testsuite/ * c-c++-common/gomp/directive-1.c: New test. * c-c++-common/gomp/clauses-6.c: New test. * c-c++-common/gomp/declare-variant-2.c (f75a): Declare. (f75): Use f75a as variant instead of f1 and don't expect error. * g++.dg/gomp/clause-4.C (foo): Don't expect error on comma before first clause. * gcc.dg/gomp/clause-2.c (foo): Likewise. (cherry picked from commit 89999f2358724fa4e71c7c3b4de340582c0e43da)
2022-10-28Merge commit '9b116c51a451995f1bae8fdac0748fcf3f06aafe'Thomas Schwinge3-1/+17
2022-10-28[og12] OpenACC: Don't gang-privatize artificial variables: restrict to ↵Thomas Schwinge2-0/+7
blocks: ChangeLog ... forgotten in og12 commit 9a50d282f03f7f1e1ad00de917143a2a8e0c0ee0 "[og12] OpenACC: Don't gang-privatize artificial variables: restrict to blocks".
2022-10-28OpenACC: Don't gang-privatize artificial variables [PR90115]Julian Brown6-37/+44
This patch prevents compiler-generated artificial variables from being treated as privatization candidates for OpenACC. The rationale is that e.g. "gang-private" variables actually must be shared by each worker and vector spawned within a particular gang, but that sharing is not necessary for any compiler-generated variable (at least at present, but no such need is anticipated either). Variables on the stack (and machine registers) are already private per-"thread" (gang, worker and/or vector), and that's fine for artificial variables. We're restricting this to blocks, as we still need to understand what it means for a 'DECL_ARTIFICIAL' to appear in a 'private' clause. Several tests need their scan output patterns adjusted to compensate. 2022-10-14 Julian Brown <julian@codesourcery.com> PR middle-end/90115 gcc/ * omp-low.cc (oacc_privatization_candidate_p): Artificial vars are not privatization candidates. libgomp/ * testsuite/libgomp.oacc-fortran/declare-1.f90: Adjust scan output. * testsuite/libgomp.oacc-fortran/host_data-5.F90: Likewise. * testsuite/libgomp.oacc-fortran/if-1.f90: Likewise. * testsuite/libgomp.oacc-fortran/print-1.f90: Likewise. * testsuite/libgomp.oacc-fortran/privatized-ref-2.f90: Likewise. Co-authored-by: Thomas Schwinge <thomas@codesourcery.com> (cherry picked from commit 11e811d8e2f63667f60f73731bb934273f5882b8)
2022-10-28[og12] OpenACC: Don't gang-privatize artificial variables: restrict to blocksThomas Schwinge2-2/+4
Follow-up to og12 commit d4504346d2a1d6ffecb8b2d8e3e04ab8ea259785 "[og12] OpenACC: Don't gang-privatize artificial variables", to restore the previous behavior, until we understand what it means for a 'DECL_ARTIFICIAL' to appear in a 'private' clause. gcc/ * omp-low.cc (oacc_privatization_candidate_p) <DECL_ARTIFICIAL>: Restrict to 'block's. libgomp/ * testsuite/libgomp.oacc-fortran/privatized-ref-2.f90: Adjust.
2022-10-28Resolve '-Wsign-compare' issue in ↵Thomas Schwinge1-0/+5
'gcc/omp-low.cc:lower_rec_simd_input_clauses': ChangeLog ... forgotten in og12 commit 4e32d1582a137d5f34248fdd3e93d35a798f5221 "Resolve '-Wsign-compare' issue in 'gcc/omp-low.cc:lower_rec_simd_input_clauses'".
2022-10-28Resolve '-Wsign-compare' issue in 'gcc/omp-low.cc:lower_rec_simd_input_clauses'Thomas Schwinge1-2/+2
..., introduced in og12 commit 55722a87dd223149dcd41ca9c8eba16ad5b3eddc "openmp: fix max_vf setting for amdgcn offloading": In file included from [...]/source-gcc/gcc/coretypes.h:482, from [...]/source-gcc/gcc/omp-low.cc:27: [...]/source-gcc/gcc/poly-int.h: In instantiation of ‘typename if_nonpoly<Ca, bool>::type maybe_lt(const Ca&, const poly_int_pod<N, Cb>&) [with unsigned int N = 1; Ca = int; Cb = long unsigned int; typename if_nonpoly<Ca, bool>::type = bool]’: [...]/source-gcc/gcc/poly-int.h:1510:7: required from ‘poly_int<N, typename poly_result<Ca, typename if_nonpoly<Cb>::type>::type> ordered_max(const poly_int_pod<N, C>&, const Cb&) [with unsigned int N = 1; Ca = long unsigned int; Cb = int; typename poly_result<Ca, typename if_nonpoly<Cb>::type>::type = long unsigned int; typename if_nonpoly<Cb>::type = int]’ [...]/source-gcc/gcc/omp-low.cc:5180:33: required from here [...]/source-gcc/gcc/poly-int.h:1384:12: error: comparison of integer expressions of different signedness: ‘const int’ and ‘const long unsigned int’ [-Werror=sign-compare] 1384 | return a < b.coeffs[0]; | ~~^~~~~~~~~~~ [...]/source-gcc/gcc/poly-int.h: In instantiation of ‘typename if_nonpoly<Cb, bool>::type maybe_lt(const poly_int_pod<N, C>&, const Cb&) [with unsigned int N = 1; Ca = long unsigned int; Cb = int; typename if_nonpoly<Cb, bool>::type = bool]’: [...]/source-gcc/gcc/poly-int.h:1515:2: required from ‘poly_int<N, typename poly_result<Ca, typename if_nonpoly<Cb>::type>::type> ordered_max(const poly_int_pod<N, C>&, const Cb&) [with unsigned int N = 1; Ca = long unsigned int; Cb = int; typename poly_result<Ca, typename if_nonpoly<Cb>::type>::type = long unsigned int; typename if_nonpoly<Cb>::type = int]’ [...]/source-gcc/gcc/omp-low.cc:5180:33: required from here [...]/source-gcc/gcc/poly-int.h:1373:22: error: comparison of integer expressions of different signedness: ‘const long unsigned int’ and ‘const int’ [-Werror=sign-compare] 1373 | return a.coeffs[0] < b; | ~~~~~~~~~~~~^~~ gcc/ * omp-low.cc (lower_rec_simd_input_clauses): For 'ordered_max', cast 'omp_max_simt_vf ()', 'omp_max_simd_vf ()' to 'unsigned'.
2022-10-28Fix target selector syntax in 'gcc.dg/vect/bb-slp-cond-1.c'Thomas Schwinge2-1/+8
... to restore testing lost in recent commit r13-3225-gbd9a05594d227cde79a67dc715bd9d82e9c464e9 "amdgcn: vector testsuite tweaks" (for example, x86_64-pc-linux-gnu): PASS: gcc.dg/vect/bb-slp-cond-1.c (test for excess errors) PASS: gcc.dg/vect/bb-slp-cond-1.c -flto -ffat-lto-objects scan-tree-dump vect "(no need for alias check [^\\n]* when VF is 1|no alias between [^\\n]* when [^\\n]* is outside \\(-16, 16\\))" [-PASS: gcc.dg/vect/bb-slp-cond-1.c -flto -ffat-lto-objects scan-tree-dump-times vect "loop vectorized" 1-] PASS: gcc.dg/vect/bb-slp-cond-1.c -flto -ffat-lto-objects (test for excess errors) PASS: gcc.dg/vect/bb-slp-cond-1.c -flto -ffat-lto-objects execution test PASS: gcc.dg/vect/bb-slp-cond-1.c execution test PASS: gcc.dg/vect/bb-slp-cond-1.c scan-tree-dump vect "(no need for alias check [^\\n]* when VF is 1|no alias between [^\\n]* when [^\\n]* is outside \\(-16, 16\\))" [-PASS: gcc.dg/vect/bb-slp-cond-1.c scan-tree-dump-times vect "loop vectorized" 1-] gcc/testsuite/ * gcc.dg/vect/bb-slp-cond-1.c: Fix target selector syntax. (cherry picked from commit 0607307768b66a90e27c5bc91a247acc938f070e)
2022-10-28Daily bump.GCC Administrator3-1/+17
2022-10-27openacc: Revert erroneous gang reduction changesMarcel Vollweiler6-46/+19
This patch reverts some changes related to "gang reduction on an orphan loop" of commit 3a5e525489f2f808093ae1f12b5d2b406f571ec7 "Various OpenACC reduction enhancements - FE change" similar to the mainline commit 77d24d43644909852998043335b5a0e09d1e8f02. gcc/c/ChangeLog: * c-typeck.cc (c_finish_omp_clauses): Remove "gang reduction on an orphan loop" checking. gcc/cp/ChangeLog: * semantics.cc (finish_omp_clauses): Remove "gang reduction on an orphan loop" checking. gcc/fortran/ChangeLog: * openmp.cc (oacc_is_parallel): Remove. (resolve_oacc_loop_blocks): Remove "gang reduction on an orphan loop" checking.
2022-10-27openacc: Revert erroneous gang reduction change in OpenAcc testMarcel Vollweiler2-4/+8
This patch reverts an erroneous modification of an OpenAcc test case in d27d6c9e1e3bc18ba0113757b743b306ea69f825 "Various OpenACC reduction enhancements - test cases". The same reversion was already done on mainline with commit 77d24d43644909852998043335b5a0e09d1e8f02. gcc/testsuite/ChangeLog: * gfortran.dg/goacc/orphan-reductions-1.f90: Adjust.
2022-10-27Merge branch 'releases/gcc-12' into devel/omp/gcc-12Tobias Burnus19-35/+227
Merge up to r12-8872-gca0220d42e075194ca1341c98a0a9a9f3fd1c719 (27th Oct 2022)
2022-10-27lto: do not load LTO stream for aliases [PR107418]Martin Liska1-1/+2
PR lto/107418 gcc/lto/ChangeLog: * lto-dump.cc (lto_main): Do not load LTO stream for aliases. (cherry picked from commit be6c75547385c69706370f4e792b04295f708a5a)
2022-10-27IRA: Make sure array is big enoughTorbjörn SVENSSON1-0/+1
In commit 081c96621da, the call to resize_reg_info() was moved before the call to remove_scratches() and the latter one can increase the number of regs and that would cause an out of bounds usage on the reg_renumber global array. Without this patch, the following testcase randomly fails with: during RTL pass: ira In file included from /src/gcc/testsuite/gcc.dg/compat/struct-by-value-5b_y.c:13: /src/gcc/testsuite/gcc.dg/compat/struct-by-value-5b_y.c: In function 'checkgSf13': /src/gcc/testsuite/gcc.dg/compat/fp-struct-test-by-value-y.h:28:1: internal compiler error: Segmentation fault /src/gcc/testsuite/gcc.dg/compat/struct-by-value-5b_y.c:22:1: note: in expansion of macro 'TEST' gcc/ChangeLog: * ira.cc: Resize array after reg number increased. Co-Authored-By: Yvan ROUX <yvan.roux@foss.st.com> Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com> (cherry picked from commit 4e1d704243a4f3c4ded47cd0d02427bb7efef069)
2022-10-27Daily bump.GCC Administrator3-1/+24
2022-10-26aarch64: update Ampere-1 core definitionPhilipp Tomsich1-1/+1
This brings the extensions detected by -mcpu=native on Ampere-1 systems in sync with the defaults generated for -mcpu=ampere1. Note that some early kernel versions on Ampere1 may misreport the presence of PAUTH and PREDRES (i.e., -mcpu=native will add 'nopauth' and 'nopredres'). gcc/ChangeLog: * config/aarch64/aarch64-cores.def (AARCH64_CORE): Update Ampere-1 core entry. (cherry picked from commit db2f5d661239737157cf131de7d4df1c17d8d88d)
2022-10-26aarch64: fix off-by-one in reading cpuinfoPhilipp Tomsich3-2/+25
Fixes: 341573406b39 Don't subtract one from the result of strnlen() when trying to point to the first character after the current string. This issue would cause individual characters (where the 128 byte buffers are stitched together) to be lost. gcc/ChangeLog: * config/aarch64/driver-aarch64.cc (readline): Fix off-by-one. gcc/testsuite/ChangeLog: * gcc.target/aarch64/cpunative/info_18: New test. * gcc.target/aarch64/cpunative/native_cpu_18.c: New test. (cherry picked from commit b1cfbccc41de6aec950c0f662e7e85ab34bfff8a)
2022-10-26Handle operator new with alignment in usm transform.Hafiz Abid Qadeer7-4/+120
Since C++17, the is a variant of operator new with alignment. This patch converts it to omp_aligned_alloc when unified shared memory is being used. gcc/ChangeLog: * omp-low.cc (usm_transform): Handle operator new with alignment. libgomp/ChangeLog: * testsuite/libgomp.c++/usm-2.C: New test. gcc/testsuite/ChangeLog: * g++.dg/gomp/usm-4.C: New test. * g++.dg/gomp/usm-5.C: New test.
2022-10-26Daily bump.GCC Administrator3-1/+51