aboutsummaryrefslogtreecommitdiff
path: root/gcc
AgeCommit message (Collapse)AuthorFilesLines
2023-08-23i386: Fix register spill failure with concat RTX [PR111010]Uros Bizjak1-2/+4
Disable (=&r,m,m) alternative for 32-bit targets. The combination of two memory operands (possibly with complex addressing mode), early clobbered output, frame pointer and PIC registers uses too much registers on a register constrained 32-bit target. PR target/111010 gcc/ChangeLog: * config/i386/i386.md (*concat<any_or_plus:mode><dwi>3_3): Disable (=&r,m,m) alternative for 32-bit targets. (*concat<any_or_plus:mode><dwi>3_4): Ditto.
2023-08-23Daily bump.GCC Administrator2-1/+18
2023-08-23RISC-V: Add riscv-vsetvl.def to t-riscvJuzhe-Zhong1-1/+2
This patch will be backport to GCC 13 and commit to trunk. gcc/ChangeLog: * config/riscv/t-riscv: Add riscv-vsetvl.def
2023-08-22doc: Remove obsolete sentence about _Float* not being supported in C++ ↵Jakub Jelinek1-1/+1
[PR106652] As mentioned in the PR, these types are supported in C++ since GCC 13, so we shouldn't confuse users. 2023-08-22 Jakub Jelinek <jakub@redhat.com> PR c++/106652 * doc/extend.texi (_Float<n>): Drop obsolete sentence that the types aren't supported in C++. (cherry picked from commit 145da6a8e1ad60f048069012d81e37f84e1585fd)
2023-08-22RISCV: Fix PR111074 [GCC13 BUG]xuli1-0/+3
his patch fixes this issue happens on GCC-13. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111074 This patch should be backported to GCC-13. GCC-14 has rewritten propagate_avl function, so there is no issue. PR target/111074 gcc/ChangeLog: * config/riscv/riscv-vsetvl.cc (extract_single_source): Fix bug.
2023-08-22Daily bump.GCC Administrator2-1/+11
2023-08-21Support -march=gracemontliuhongt2-0/+5
Alderlake-N is E-core only, add it as an alias of Alderlake. gcc/ChangeLog: * common/config/i386/cpuinfo.h (get_intel_cpu): Detect Alderlake-N. * common/config/i386/i386-common.cc (alias_table): Support -march=gracemont as an alias of -march=alderlake. (cherry picked from commit f847e0195ddab27d3d55b348c1ab6857c2a00d9d)
2023-08-21Daily bump.GCC Administrator1-1/+1
2023-08-20Daily bump.GCC Administrator2-1/+11
2023-08-19Loongarch: Fix plugin header missing install.Guo Jie1-0/+4
gcc/ChangeLog: * config/loongarch/t-loongarch: Add loongarch-driver.h into TM_H. Add loongarch-def.h and loongarch-tune.h into OPTIONS_H_EXTRA. Co-authored-by: Lulu Cheng <chenglulu@loongson.cn> (cherry picked from commit 3e3157363863ed599c367645af4f94ae32a5bdc2)
2023-08-19Daily bump.GCC Administrator1-1/+1
2023-08-18OpenMP: C++ attribute syntax fixes/testcases for loop transformationsSandra Loosemore12-24/+872
gcc/cp/ChangeLog * parser.cc (cp_parser_omp_all_clauses): Allow comma before first clause. (cp_parser_see_omp_loop_nest): Accept C++ standard attributes before RID_FOR. (cp_parser_omp_loop_nest): Process C++ standard attributes like pragmas. Improve error handling for bad pragmas/attributes. Use cp_parser_see_omp_loop_nest instead of duplicating what it does. (cp_parser_omp_tile_sizes): Permit comma before the clause. (cp_parser_omp_tile): Assert that this isn't called for inner directive. (cp_parser_omp_unroll): Likewise. gcc/testsuite/ChangeLog * g++.dg/gomp/loop-transforms/attrs-tile-1.C: New file. * g++.dg/gomp/loop-transforms/attrs-tile-2.C: New file. * g++.dg/gomp/loop-transforms/attrs-tile-3.C: New file. * g++.dg/gomp/loop-transforms/attrs-unroll-1.C: New file. * g++.dg/gomp/loop-transforms/attrs-unroll-2.C: New file. * g++.dg/gomp/loop-transforms/attrs-unroll-3.C: New file. * g++.dg/gomp/loop-transforms/attrs-unroll-inner-1.C: New file. * g++.dg/gomp/loop-transforms/attrs-unroll-inner-2.C: New file. * g++.dg/gomp/loop-transforms/attrs-unroll-inner-3.C: New file.
2023-08-18OpenMP: C++ attribute syntax fixes/testcases for "declare mapper"Sandra Loosemore9-2/+173
gcc/c-family/ChangeLog * c-omp.cc (c_omp_directives): Uncomment "declare mapper" entry. gcc/cp/ChangeLog * parser.cc (cp_parser_omp_declare_mapper): Allow commas between clauses. gcc/testsuite/ChangeLog * g++.dg/gomp/attrs-declare-mapper-3.C: New file. * g++.dg/gomp/attrs-declare-mapper-4.C: New file. * g++.dg/gomp/attrs-declare-mapper-5.C: New file. * g++.dg/gomp/attrs-declare-mapper-6.C: New file.
2023-08-18OpenMP: C++ attribute syntax fixes/testcases for "metadirective"Sandra Loosemore11-0/+321
gcc/cp/ChangeLog: * parser.cc (analyze_metadirective_body): Handle CPP_PRAGMA and CPP_PRAGMA_EOL. (cp_parser_omp_metadirective): Allow comma between clauses. gcc/testsuite/ChangeLog: * g++.dg/gomp/attrs-metadirective-1.C: New file. * g++.dg/gomp/attrs-metadirective-2.C: New file. * g++.dg/gomp/attrs-metadirective-3.C: New file. * g++.dg/gomp/attrs-metadirective-4.C: New file. * g++.dg/gomp/attrs-metadirective-5.C: New file. * g++.dg/gomp/attrs-metadirective-6.C: New file. * g++.dg/gomp/attrs-metadirective-7.C: New file. * g++.dg/gomp/attrs-metadirective-8.C: New file.
2023-08-18Merge branch 'releases/gcc-13' into devel/omp/gcc-13Tobias Burnus23-40/+189
Merge up to r13-7731-g91a5bdf2941a67590211c907181e9e0036288593 (18th Aug 2023)
2023-08-18Daily bump.GCC Administrator1-1/+1
2023-08-17Daily bump.GCC Administrator4-1/+68
2023-08-16c++: dependently scoped template-id in type-req [PR110927]Patrick Palka2-2/+29
Here we're incorrectly rejecting the first type-requirement at parse time with concepts-requires35.C:14:56: error: ‘typename A<T>::B’ is not a template [-fpermissive] We also incorrectly reject the second type-requirement at satisfaction time with concepts-requires35.C:17:34: error: ‘typename A<int>::B’ names ‘template<class U> struct A<int>::B’, which is not a type and similarly for the third type-requirement. This seems to happen only within a type-requirement; if we instead use e.g. an alias template then it works as expected. The difference ultimately seems to be that during parsing of a using-decl, we pass check_dependency_p=true to cp_parser_nested_name_specifier_opt whereas for a type-requirement we pass check_dependency_p=false. Passing =false causes cp_parser_template_id for the dependently-scoped template-id B<bool> to create a TYPE_DECL of TYPENAME_TYPE (with TYPENAME_IS_CLASS_P unexpectedly set in the last two cases) whereas passing =true causes it to return a TEMPLATE_ID_EXPR. We then call make_typename_type on this TYPE_DECL which does the wrong thing. Since there seems to be no justification for using check_dependency_p=false here, the simplest fix seems to be to pass check_dependency_p=true instead, matching the behavior of cp_parser_elaborated_type_specifier. PR c++/110927 gcc/cp/ChangeLog: * parser.cc (cp_parser_type_requirement): Pass check_dependency_p=true instead of =false. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/concepts-requires35.C: New test. (cherry picked from commit 63bd36be990f3b08fcee5b69718ef97c055fbb31)
2023-08-16Support -m[no-]gather -m[no-]scatter to enable/disable vectorization for all ↵liuhongt6-22/+56
gather/scatter instructions Rename original use_gather to use_gather_8parts, Support -mtune-ctrl={,^}use_gather to set/clear tune features use_gather_{2parts, 4parts, 8parts}. Support the new option -mgather as alias of -mtune-ctrl=, use_gather, ^use_gather. Similar for use_scatter. gcc/ChangeLog: * config/i386/i386-builtins.cc (ix86_vectorize_builtin_gather): Adjust for use_gather_8parts. * config/i386/i386-options.cc (parse_mtune_ctrl_str): Set/Clear tune features use_{gather,scatter}_{2parts, 4parts, 8parts} for -mtune-crtl={,^}{use_gather,use_scatter}. * config/i386/i386.cc (ix86_vectorize_builtin_scatter): Adjust for use_scatter_8parts * config/i386/i386.h (TARGET_USE_GATHER): Rename to .. (TARGET_USE_GATHER_8PARTS): .. this. (TARGET_USE_SCATTER): Rename to .. (TARGET_USE_SCATTER_8PARTS): .. this. * config/i386/x86-tune.def (X86_TUNE_USE_GATHER): Rename to (X86_TUNE_USE_GATHER_8PARTS): .. this. (X86_TUNE_USE_SCATTER): Rename to (X86_TUNE_USE_SCATTER_8PARTS): .. this. * config/i386/i386.opt: Add new options mgather, mscatter. (cherry picked from commit b2a927fb5343db363ea4361da0d6bcee227b6737)
2023-08-16Software mitigation: Disable gather generation in vectorization for GDS ↵liuhongt12-13/+21
affected Intel Processors. For more details of GDS (Gather Data Sampling), refer to https://www.intel.com/content/www/us/en/developer/articles/technical/software-security-guidance/advisory-guidance/gather-data-sampling.html After microcode update, there's performance regression. To avoid that, the patch disables gather generation in autovectorization but uses gather scalar emulation instead. gcc/ChangeLog: * config/i386/i386-options.cc (m_GDS): New macro. * config/i386/x86-tune.def (X86_TUNE_USE_GATHER_2PARTS): Don't enable for m_GDS. (X86_TUNE_USE_GATHER_4PARTS): Ditto. (X86_TUNE_USE_GATHER): Ditto. gcc/testsuite/ChangeLog: * gcc.target/i386/avx2-gather-2.c: Adjust options to keep gather vectorization. * gcc.target/i386/avx2-gather-6.c: Ditto. * gcc.target/i386/avx512f-pr88464-1.c: Ditto. * gcc.target/i386/avx512f-pr88464-5.c: Ditto. * gcc.target/i386/avx512vl-pr88464-1.c: Ditto. * gcc.target/i386/avx512vl-pr88464-11.c: Ditto. * gcc.target/i386/avx512vl-pr88464-3.c: Ditto. * gcc.target/i386/avx512vl-pr88464-9.c: Ditto. * gcc.target/i386/pr88531-1b.c: Ditto. * gcc.target/i386/pr88531-1c.c: Ditto. (cherry picked from commit 3064d1f5c48cb6ce1b4133570dd08ecca8abb52d)
2023-08-16Daily bump.GCC Administrator2-1/+9
2023-08-15x86: Update model values for Alderlake and Rocketlake.Cui, Lili1-2/+0
Fix build failure of commit 0fa76e35a5f9e141c08fdf151380f2f9689101c7 Update model values for Alderlake and Rocketlake according to SDM. gcc/ChangeLog * common/config/i386/cpuinfo.h (get_intel_cpu): Remove model value 0xa8 from Rocketlake, and 0xbf from Alderlake. (cherry picked from commit e510c3be13a8ccdf1fc1b27c2501c126d493f335)
2023-08-15Daily bump.GCC Administrator2-1/+6
2023-08-14Merge commit 'releases/gcc-13' into devel/omp/gcc-13Tobias Burnus351-64554/+73668
Merge up to r13-7719-g361ad1f91a0de3ee1b16bb6bf8b538448c15d942 (14th Aug 2023)
2023-08-14x86: Update model values for Raptorlake.Cui, Lili1-0/+2
Update model values for Raptorlake according to SDM. gcc/ChangeLog * common/config/i386/cpuinfo.h (get_intel_cpu): Add model value 0xba to Raptorlake.
2023-08-14Daily bump.GCC Administrator2-1/+9
2023-08-13modula-2, plugin: Fix Darwin bootstrap issues.Iain Sandoe1-2/+3
This corrects some typos in the suffix of the m2rte pluing that lead to a bootstrap fail on Darwin, where the suffix is not '.so'. On some versions of Darwin, the linker complains if libSystem is not linked, so we disable all the default libs, but add libc back. Signed-off-by: Iain Sandoe <iain@sandoe.co.uk> gcc/m2/ChangeLog: * Make-lang.in: Update suffix spellings to use 'soext'. Add libc to the plugin link. (cherry picked from commit 25be11e982c76200fabb375c8c63eff8c6856980)
2023-08-13Daily bump.GCC Administrator3-1/+43
2023-08-12PR modula2/110779 SysClock can not read the clock (Darwin fixes)Gaius Mulley2-8/+38
This patch adds corrections to defensively check against glibc functions, structures and contains fallbacks. These fixes were required under Darwin. gcc/m2/ChangeLog: PR modula2/110779 * gm2-libs-iso/SysClock.mod (EpochTime): New procedure. (GetClock): Call EpochTime if the C time functions are unavailable. * gm2-libs-iso/wrapclock.def (istimezone): New function definition. libgm2/ChangeLog: PR modula2/110779 * configure: Regenerate. * configure.ac: Provide special case test for Darwin cross configuration. (GLIBCXX_CONFIGURE): New statement. (GLIBCXX_CHECK_GETTIMEOFDAY): New statement. (GLIBCXX_ENABLE_LIBSTDCXX_TIME): New statement. * libm2iso/wrapclock.cc: New sys/time.h conditional include. (sys/syscall.h): Conditional include. (unistd.h): Conditional include. (GetTimeRealtime): Re-implement. (SetTimeRealtime): Re-implement. (timezone): Re-implement. (istimezone): New function. (daylight): Re-implement. (isdst): Re-implement. (tzname): Re-implement. Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2023-08-12PR modula2/108119 disable m2rte plugin by defaultGaius Mulley7-14/+21
This patch disables the m2rte plugin by default. The driver will only append the -fplugin=m2rte command line option for cc1gm2 if -fm2-plugin is present. It only enabled providing ENABLE_PLUGIN is defined. gcc/m2/Make-file.in will only build and install m2rte if enable_plugin is yes. gcc/m2/ChangeLog: PR modula2/108119 * Make-lang.in (M2RTE_PLUGIN_SO): Assigned to plugin/m2rte$(exeext).so if enable_plugin is yes. (m2.all.cross): Replace plugin/m2rte$(soext) with $(M2RTE_PLUGIN_SO). (m2.all.encap): Replace plugin/m2rte$(soext) with $(M2RTE_PLUGIN_SO). (m2.install-plugin): Add dummy rule when enable_plugin is not yes. (plugin/m2rte$(exeext).so): Add dummy rule when enable_plugin is not yes. (m2/stage2/cc1gm2$(exeext)): Replace plugin/m2rte$(soext) with $(M2RTE_PLUGIN_SO). (m2/stage1/cc1gm2$(exeext)): Replace plugin/m2rte$(soext) with $(M2RTE_PLUGIN_SO). * gm2spec.cc (lang_specific_driver): Set need_plugin to false by default. gcc/testsuite/ChangeLog: PR modula2/108119 * gm2/iso/check/fail/iso-check-fail.exp (gm2_init_iso): Add -fm2-plugin. * gm2/switches/auto-init/fail/switches-auto-init-fail.exp (gm2_init_iso): Add -fm2-plugin. * gm2/switches/check-all/pim2/fail/switches-check-all-pim2-fail.exp (gm2_init_pim2): Add -fm2-plugin. * gm2/switches/check-all/plugin/iso/fail/switches-check-all-plugin-iso-fail.exp (gm2_init_iso): Add -fm2-plugin. * gm2/switches/check-all/plugin/pim2/fail/switches-check-all-plugin-pim2-fail.exp (gm2_init_pim2): Add -fm2-plugin. Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2023-08-12Daily bump.GCC Administrator3-1/+23
2023-08-11c++: std::variant slow to compile [PR109678]Jason Merrill2-9/+60
Here, when dealing with a class with a complex subobject structure, we would try and fail to find the relevant FIELD_DECL for an empty base before giving up. And we would do this at each level, in a combinatorially problematic way. Instead, we should check for an empty base first. PR c++/109678 gcc/cp/ChangeLog: * constexpr.cc (cxx_fold_indirect_ref_1): Handle empty base first. gcc/testsuite/ChangeLog: * g++.dg/cpp1z/variant1.C: New test.
2023-08-11c++: member vs global template [PR106310]Jason Merrill2-7/+31
For backward compatibility we still want to allow patterns like this->A<T>::foo, but the template keyword in a qualified name is specifically to specify that a dependent name is a template, so don't look in the enclosing scope at all. Also fix handling of dependent bases: if member lookup in the current instantiation fails and we have dependent bases, the lookup is dependent. We were already handling that for the case where lookup in the enclosing scope also fails, but we also want it to affect that lookup itself. PR c++/106310 gcc/cp/ChangeLog: * parser.cc (cp_parser_template_name): Skip non-member lookup after the template keyword. (cp_parser_lookup_name): Pass down template_keyword_p. gcc/testsuite/ChangeLog: * g++.dg/template/template-keyword4.C: New test.
2023-08-11Daily bump.GCC Administrator3-1/+21
2023-08-10OpenMP: Enable 'declare mapper' mappers for 'target update' directivesJulian Brown16-56/+677
This patch enables use of 'declare mapper' for 'target update' directives, for each of C, C++ and Fortran. There are some implementation choices here and some "read-between-the-lines" consequences regarding this functionality, as follows: * It is possible to invoke a mapper which contains clauses that don't make sense for a given 'target update' operation. E.g. if a mapper definition specifies a "from:" mapping and the user does "target update to(...)" which triggers that mapper, the resulting map kind (OpenMP 5.2, "Table 5.3: Map-Type Decay of Map Type Combinations") is "alloc" (and for the inverse case "release"). For such cases, an unconditional warning is issued and the map clause in question is dropped from the mapper expansion. (Other choices might be to make this an error, or to do the same thing but silently, or warn only given some special option.) * The array-shaping operator is *permitted* for map clauses within 'declare mapper' definitions. That is because such mappers may be used for 'target update' directives, where the array-shaping operator is permitted. I think that makes sense, depending on the semantic model of how and when substitution is supposed to take place, but I couldn't find such behaviour explicitly mentioned in the spec (as of 5.2). If the mapper is triggered by a different directive ("omp target", "omp target data", etc.), an error will be raised. Support is also added for the "mapper" modifier on to/from clauses for all three base languages. 2023-08-10 Julian Brown <julian@codesourcery.com> gcc/c-family/ * c-common.h (c_omp_region_type): Add C_ORT_UPDATE and C_ORT_OMP_UPDATE codes. * c-omp.cc (omp_basic_map_kind_name): New function. (omp_instantiate_mapper): Add LOC parameter. Add 'target update' support. (c_omp_instantiate_mappers): Add 'target update' support. gcc/c/ * c-parser.cc (c_parser_omp_variable_list): Support array-shaping operator in 'declare mapper' definitions. (c_parser_omp_clause_map): Pass C_ORT_OMP_DECLARE_MAPPER to c_parser_omp_variable_list in mapper definitions. (c_parser_omp_clause_from_to): Add parsing for mapper modifier. (c_parser_omp_target_update): Instantiate mappers. gcc/cp/ * parser.cc (cp_parser_omp_var_list_no_open): Support array-shaping operator in 'declare mapper' definitions. (cp_parser_omp_clause_from_to): Add parsing for mapper modifier. (cp_parser_omp_clause_map): Pass C_ORT_OMP_DECLARE_MAPPER to cp_parser_omp_var_list_no_open in mapper definitions. (cp_parser_omp_target_update): Instantiate mappers. gcc/fortran/ * openmp.cc (gfc_match_motion_var_list): Add parsing for mapper modifier. (gfc_match_omp_clauses): Adjust error handling for changes to gfc_match_motion_var_list. * trans-openmp.cc (gfc_trans_omp_clauses): Use correct ref for update operations. (gfc_trans_omp_target_update): Instantiate mappers. gcc/testsuite/ * c-c++-common/gomp/declare-mapper-17.c: New test. * c-c++-common/gomp/declare-mapper-19.c: New test. * gfortran.dg/gomp/declare-mapper-24.f90: New test. * gfortran.dg/gomp/declare-mapper-26.f90: Uncomment 'target update' part of test. * gfortran.dg/gomp/declare-mapper-27.f90: New test. libgomp/ * testsuite/libgomp.c-c++-common/declare-mapper-18.c: New test. * testsuite/libgomp.fortran/declare-mapper-25.f90: New test. * testsuite/libgomp.fortran/declare-mapper-28.f90: New test.
2023-08-10OpenMP: Look up 'declare mapper' definitions at resolution time not parse timeJulian Brown7-12/+98
This patch moves 'declare mapper' lookup for OpenMP clauses from parse time to resolution time for Fortran, and adds diagnostics for missing named mappers. This changes clause lookup in a particular case -- where several 'declare mapper's are defined in a context, mappers declared earlier may now instantiate mappers declared later, whereas previously they would not. I think the new behaviour makes more sense -- at an invocation site, all mappers are visible no matter the declaration order in some particular block. I've adjusted tests to account for this. I think the new arrangement better matches the Fortran FE's usual way of doing things -- mapper lookup is a semantic concept, not a syntactical one, so shouldn't be handled in the syntax-handling code. The patch also fixes a case where the user explicitly writes 'default' as the name on the mapper modifier for a clause. 2023-08-10 Julian Brown <julian@codesourcery.com> gcc/fortran/ * gfortran.h (gfc_omp_namelist_udm): Add MAPPER_ID field to store the mapper name to use for lookup during resolution. * match.cc (gfc_free_omp_namelist): Handle OMP_LIST_TO and OMP_LIST_FROM when freeing mapper references. * module.cc (load_omp_udms, write_omp_udm): Handle MAPPER_ID field. * openmp.cc (gfc_match_omp_clauses): Handle explicitly-specified 'default' name. Don't do mapper lookup here, but record mapper name if the user specifies one. (resolve_omp_clauses): Do mapper lookup here instead. Report error for missing named mapper. gcc/testsuite/ * gfortran.dg/gomp/declare-mapper-31.f90: New test. libgomp/ * testsuite/libgomp.fortran/declare-mapper-30.f90: New test. * testsuite/libgomp.fortran/declare-mapper-4.f90: Adjust test for new lookup behaviour.
2023-08-10OpenMP: Introduce C_ORT_{,OMP_}DECLARE_MAPPER c_omp_region_type typesJulian Brown4-2/+14
This patch adds C_ORT_DECLARE_MAPPER and C_ORT_OMP_DECLARE_MAPPER region types to the c_omp_region_type enum, and uses them in cp/pt.cc. Previously the C_ORT_DECLARE_SIMD code was being abused to inhibit calling finish_omp_clauses within mapper definitions, but this patch uses one of the new enumeration values for that purpose instead. This shouldn't result in any behaviour change, but improves self-documentation. 2023-08-10 Julian Brown <julian@codesourcery.com> gcc/c-family/ * c-common.h (c_omp_region_type): Add C_ORT_DECLARE_MAPPER and C_ORT_OMP_DECLARE_MAPPER codes. gcc/cp/ * pt.cc (tsubst_omp_clauses): Use C_ORT_OMP_DECLARE_MAPPER. (tsubst_expr): Likewise.
2023-08-10OpenMP: Reprocess expanded clauses after 'declare mapper' instantiationJulian Brown6-501/+655
This patch reprocesses expanded clauses after 'declare mapper' instantiation -- checking things such as duplicated clauses, illegal use of strided accesses, and so forth. Two functions are broken out of the 'resolve_omp_clauses' function and reused in a new function 'resolve_omp_mapper_clauses', called after mapper instantiation. This improves diagnostic output. 2023-08-10 Julian Brown <julian@codesourcery.com> gcc/fortran/ * gfortran.h (gfc_omp_clauses): Add NS field. * openmp.cc (verify_omp_clauses_symbol_dups, omp_verify_map_motion_clauses): New functions, broken out of... (resolve_omp_clauses): Here. Record namespace containing clauses. Call above functions. (resolve_omp_mapper_clauses): New function, using helper functions broken out above. (gfc_resolve_omp_directive): Add NS parameter to resolve_omp_clauses calls. (gfc_omp_instantiate_mappers): Call resolve_omp_mapper_clauses if we instantiate any mappers. gcc/testsuite/ * gfortran.dg/gomp/declare-mapper-26.f90: New test. * gfortran.dg/gomp/declare-mapper-29.f90: New test.
2023-08-10OpenMP: Move Fortran 'declare mapper' instantiation codeJulian Brown4-383/+475
This patch moves the code for explicit 'declare mapper' directive instantiation in the Fortran front-end to openmp.cc from trans-openmp.cc. The transformation takes place entirely in the front end's own representation and doesn't involve middle-end trees at all. Also, having the code in openmp.cc is more convenient for the following patch that introduces the 'resolve_omp_mapper_clauses' function. 2023-08-10 Julian Brown <julian@codesourcery.com> gcc/fortran/ * gfortran.h (toc_directive): Move here. (gfc_omp_instantiate_mappers, gfc_get_location): Add prototypes. * openmp.cc (omp_split_map_op, omp_join_map_op, omp_map_decayed_kind, omp_basic_map_kind_name, gfc_subst_replace, gfc_subst_prepend_ref, gfc_subst_in_expr_1, gfc_subst_in_expr, gfc_subst_mapper_var): Move here. (gfc_omp_instantiate_mapper, gfc_omp_instantiate_mappers): Move here and rename. * trans-openmp.cc (toc_directive, omp_split_map_op, omp_join_map_op, omp_map_decayed_kind, gfc_subst_replace, gfc_subst_prepend_ref, gfc_subst_in_expr_1, gfc_subst_in_expr, gfc_subst_mapper_var, gfc_trans_omp_instantiate_mapper, gfc_trans_omp_instantiate_mappers): Remove from here. (gfc_trans_omp_target, gfc_trans_omp_target_data, gfc_trans_omp_target_enter_data, gfc_trans_omp_target_exit_data): Rename calls to gfc_omp_instantiate_mappers.
2023-08-10RISC-V: Fix VLMAX AVL incorrect local anticipate [VSETVL PASS]Juzhe-Zhong13-54/+53
Realize we have a bug in VSETVL PASS which is triggered by strided_load_run-1.c in RV32 system. FAIL: gcc.target/riscv/rvv/autovec/gather-scatter/strided_load_run-1.c execution test FAIL: gcc.target/riscv/rvv/autovec/gather-scatter/strided_load_run-1.c execution test FAIL: gcc.target/riscv/rvv/autovec/gather-scatter/strided_load_run-1.c execution test FAIL: gcc.target/riscv/rvv/autovec/gather-scatter/strided_load_run-1.c execution test This is because VSETVL PASS incorrect hoist vsetvl instruction: ... 10156: 0d9075d7 vsetvli a1,zero,e64,m2,ta,ma ---> pollute 'a1' register which will be used by following insns. 1015a: 01d586b3 add a3,a1,t4 --------> use 'a1' 1015e: 5e070257 vmv.v.v v4,v14 10162: b7032257 vmacc.vv v4,v6,v16 10166: 26440257 vand.vv v4,v4,v8 1016a: 22880227 vs2r.v v4,(a6) 1016e: 00b6b7b3 sltu a5,a3,a1 10172: 22888227 vs2r.v v4,(a7) 10176: 9e60b157 vmv2r.v v2,v6 1017a: 97ba add a5,a5,a4 1017c: a6a62157 vmadd.vv v2,v12,v10 10180: 26240157 vand.vv v2,v2,v8 10184: 22830127 vs2r.v v2,(t1) 10188: 873e mv a4,a5 1018a: 982a add a6,a6,a0 1018c: 98aa add a7,a7,a0 1018e: 932a add t1,t1,a0 10190: 85b6 mv a1,a3 -----> set 'a1' ... gcc/ChangeLog: * config/riscv/riscv-vsetvl.cc (anticipatable_occurrence_p): Fix incorrect anticipate info. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-1.c: Adjust tests. * gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-2.c: Ditto. * gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-24.c: Ditto. * gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-25.c: Ditto. * gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-26.c: Ditto. * gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-3.c: Ditto. * gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-36.c: Ditto. * gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-4.c: Ditto. * gcc.target/riscv/rvv/vsetvl/vlmax_conflict-7.c: Ditto. * gcc.target/riscv/rvv/vsetvl/vlmax_switch_vtype-14.c: Ditto. * gcc.target/riscv/rvv/vsetvl/vlmax_switch_vtype-15.c: Ditto. * gcc.target/riscv/rvv/vsetvl/vlmax_switch_vtype-16.c: Ditto.
2023-08-10Daily bump.GCC Administrator4-1/+22
2023-08-09Fortran: Allow pure final procs contained in pure proc. [PR109684]Paul Thomas1-1/+4
2023-08-09 Steve Kargl <sgk@troutmask.apl.washington.edu> gcc/fortran PR fortran/109684 * resolve.cc (resolve_types): Exclude contained procedures with the artificial attribute from test for pureness.
2023-08-09PR modula2/110779: libgm2 fix solaris bootstrap check for tm_gmtoffGaius Mulley2-23/+32
This patch defensively checks for every C function and every struct used in wrapclock.cc. It adds return values to GetTimespec and SetTimespec to allow the module to return a code representing unavailable. gcc/m2/ChangeLog: PR modula2/110779 * gm2-libs-iso/SysClock.mod (GetClock): Test GetTimespec return value. (SetClock): Test SetTimespec return value. * gm2-libs-iso/wrapclock.def (GetTimespec): Add integer return type. (SetTimespec): Add integer return type. libgm2/ChangeLog: PR modula2/110779 * config.h.in: Regenerate. * configure: Regenerate. * configure.ac (AC_CACHE_CHECK): Check for tm_gmtoff field in struct tm. (GM2_CHECK_LIB): Check for daylight, timezone and tzname. * libm2iso/wrapclock.cc (timezone): Guard against absence of struct tm and tm_gmtoff. (daylight): Check for daylight. (timezone): Check for timezone. (isdst): Check for isdst. (tzname): Check for tzname. (GetTimeRealtime): Check for struct timespec. (SetTimeRealtime): Check for struct timespec. (InitTimespec): Check for struct timespec. (KillTimespec): Check for struct timespec. (SetTimespec): Check for struct timespec. (GetTimespec): Check for struct timespec. Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
2023-08-09Workaround possible CPUID bug in Sandy Bridge.liuhongt1-31/+36
Don't access leaf 7 subleaf 1 unless subleaf 0 says it is supported via EAX. Intel documentation says invalid subleaves return 0. We had been relying on that behavior instead of checking the max sublef number. It appears that some Sandy Bridge CPUs return at least the subleaf 0 EDX value for subleaf 1. Best guess is that this is a bug in a microcode patch since all of the bits we're seeing set in EDX were introduced after Sandy Bridge was originally released. This is causing avxvnniint16 to be incorrectly enabled with -march=native on these CPUs. gcc/ChangeLog: * common/config/i386/cpuinfo.h (get_available_features): Check max_subleaf_level for valid subleaf before use CPUID.
2023-08-09Daily bump.GCC Administrator3-1/+21
2023-08-08i386: Fix grammar typo in diagnosticJonathan Wakely1-1/+1
gcc/ChangeLog: * config/i386/i386.cc (ix86_invalid_conversion): Fix grammar. (cherry picked from commit f6ec0d16a32a1799c0f67829fae3687eb75c505b)
2023-08-08RISC-V: Fix a bug that causes an error insn.yulong7-3/+134
I test the following rvv intrinsics. vint64m1_t test_vslide1up_vx_i64m1_m(vbool64_t mask, vint64m1_t src, int64_t value, size_t vl) { return __riscv_vslide1up_vx_i64m1_m(mask, src, value, vl); } And I got an error info,t hat is error: unrecognizable insn:(insn 17 16 18 2 (set (reg:RVVMIDI 134 [ _1 ])(if_then_else:RVVMIDI (unspec:RVVMF64BI [(reg/v:SI 142 [ vl ])(const_int 2 [x2])(const_int 日 [o])(reg:SI 66 vl)(reg:SI 67 vtype)] UNSPEC_VPREDICATE (vec_merge:RVVMIDI (reg:RVVMIDI 134 [ _1 ])(unspec:RVVMIDI [(reg:sI 日 zero)] UNSPEC_VUNDEF) (reg/v:RVVMF64BI 137 [ mask ])) (unspec:RVVM1DI[(reg:sI 日 zero)] UNSPEC_VUNDEF))) This patch fix it. gcc/ChangeLog: * config/riscv/riscv-v.cc (slide1_sew64_helper): Modify. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/base/vslide1down-1.c: New test. * gcc.target/riscv/rvv/base/vslide1down-2.c: New test. * gcc.target/riscv/rvv/base/vslide1down-3.c: New test. * gcc.target/riscv/rvv/base/vslide1up-1.c: New test. * gcc.target/riscv/rvv/base/vslide1up-2.c: New test. * gcc.target/riscv/rvv/base/vslide1up-3.c: New test.
2023-08-08Daily bump.GCC Administrator4-1/+58
2023-08-07c++: constexpr empty subobject elision [PR110197]Patrick Palka3-7/+35
Now that init_subob_ctx no longer sets new_ctx.ctor for a subobject of empty type, it seems we need to ensure its callers also consistently omit entries in the parent ctx->ctor for such subobjects. We also need to allow cxx_eval_array_reference to synthesize an empty subobject even if the array CONSTRUCTOR has CONSTRUCTOR_NO_CLEARING set. PR c++/110197 gcc/cp/ChangeLog: * constexpr.cc (cxx_eval_array_reference): Allow synthesizing an empty subobject even if CONSTRUCTOR_NO_CLEARING is set. (cxx_eval_bare_aggregate): Set 'no_slot' to true more generally whenever new_ctx.ctor is set to NULL_TREE by init_subob_ctx, i.e. whenever initializing an subobject of empty type. (cxx_eval_vec_init_1): Define 'no_slot' as above and use it accordingly. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/constexpr-empty18.C: New test. * g++.dg/cpp0x/constexpr-empty19.C: New test. (cherry picked from commit a426b91b27e28985f47d16827a532fbc28c09bd7)
2023-08-07c++: passing partially inst tmpl as ttp [PR110566]Patrick Palka2-7/+17
Since the template arguments 'pargs' we pass to coerce_template_parms from coerce_template_template_parms are always a full set, we need to make sure we always pass the parameters of the most general template because if the template is partially instantiated then the levels won't match up. In the testcase below during said call to coerce_template_parms the parameters are {X, Y}, both level 1 rather than 2, and the arguments are {{int}, {N, M}}, which results in a crash during auto deduction for parameters' types. PR c++/110566 PR c++/108179 gcc/cp/ChangeLog: * pt.cc (coerce_template_template_parms): Simplify by using DECL_INNERMOST_TEMPLATE_PARMS and removing redundant asserts. Always pass the parameters of the most general template to coerce_template_parms. gcc/testsuite/ChangeLog: * g++.dg/template/ttp38.C: New test. (cherry picked from commit b3adcc60dcf3314f47f5409aecef40607f82b80b)