aboutsummaryrefslogtreecommitdiff
path: root/gcc
AgeCommit message (Collapse)AuthorFilesLines
2022-09-26OpenACC: Fix reduction tree-sharing issue [PR106982]Tobias Burnus3-8/+45
The tree for var == incoming == outgound was 'MEM <double[5]> [(double *)&reduced]' which caused the ICE "incorrect sharing of tree nodes". PR middle-end/106982 gcc/ChangeLog: * omp-low.cc (lower_oacc_reductions): Add some unshare_expr. gcc/testsuite/ChangeLog: * c-c++-common/goacc/reduction-7.c: New test. * c-c++-common/goacc/reduction-8.c: New test.
2022-09-26s390: fix wrong refactoringMartin Liska1-8/+7
Since r13-2251-g1930c5d05ceff2, the refactoring is not 1:1 and we end up with a wrong rtx type. gcc/ChangeLog: * config/s390/s390.cc (s390_rtx_costs): Remove dest variable and use only dst.
2022-09-26aarch64: Add -march support for Armv9.1-A, Armv9.2-A, Armv9.3-AKyrylo Tkachov3-0/+24
This is a straightforward patch that allows targeting the architecture revisions mentioned in the subject through -march. These are already supported in binutils. Bootstrapped and tested on aarch64-none-linux-gnu. gcc/ChangeLog: * config/aarch64/aarch64-arches.def (armv9.1-a): Define. (armv9.2-a): Likewise. (armv9.3-a): Likewise. * config/aarch64/aarch64.h (AARCH64_FL_V9_1): Likewise. (AARCH64_FL_V9_2): Likewise. (AARCH64_FL_V9_3): Likewise. (AARCH64_FL_FOR_ARCH9_1): Likewise. (AARCH64_FL_FOR_ARCH9_2): Likewise. (AARCH64_FL_FOR_ARCH9_3): Likewise. (AARCH64_ISA_V9_1): Likewise. (AARCH64_ISA_V9_2): Likewise. (AARCH64_ISA_V9_3): Likewise. * doc/invoke.texi (AArch64 Options): Document armv9.1-a, armv9.2-a, armv9.3-a values to -march.
2022-09-26ada: Doc: rename Valid_Image to Valid_ValueGhjuvan Lacambre3-16/+16
This renaming happened some time ago in the code, but the documentation was not updated. gcc/ada/ * doc/gnat_rm/implementation_defined_attributes.rst: Rename Valid_Image. * gnat_rm.texi: Regenerate. * gnat_ugn.texi: Regenerate.
2022-09-26ada: Fix location of pragmas coming from aspects in top-level instancesPiotr Trojanek1-2/+5
This patch fixes an AST anomaly where pragmas that correspond to aspects of a generic package declaration appeared as the auxiliary declarations of the compilation unit for the instantiated package body. In particular, this anomaly happened for aspect Annotate and affected GNATprove, which didn't pick pragma corresponding to this aspect. gcc/ada/ * sem_ch12.adb (Build_Instance_Compilation_Unit_Nodes): Relocate auxiliary declarations from the original compilation unit to the newly created compilation unit for the spec.
2022-09-26ada: Remove unreferenced Rtsfind entriesPiotr Trojanek1-109/+2
Remove unreferenced entries for finding runtime units and runtime entities by the compiler. Code cleanup using basic grep scripting. gcc/ada/ * rtsfind.ads (RTU_Id): Remove unreferenced packages; fix whitespace. (RE_Id): Remove unreferenced entities; add comment about entity that is only used by GNATprove and not by GNAT.
2022-09-26ada: Remove unreferenced C macro from OS constants templatePiotr Trojanek1-3/+0
The STR/STR1 macros in OS constants template has been unreferenced since 2005, so we can safely remove them. gcc/ada/ * s-oscons-tmplt.c (STR, STR1): Remove.
2022-09-26ada: Document Long_Long_Long_Size parameter for -gnateTEric Botcazou2-1/+5
This was overlooked when the new parameter was created. gcc/ada/ * doc/gnat_ugn/building_executable_programs_with_gnat.rst (-gnateT): Document new parameter Long_Long_Long_Size. * gnat_ugn.texi: Regenerate.
2022-09-26ada: Improve CUDA host-side and device-side binder supportSteve Baird1-5/+4
Binder-generated code is not allowed to use Ada2012 syntax. In order to specify an aspect, a pragma must be used. gcc/ada/ * bindgen.adb: When the binder is invoked for the device, specify the CUDA_Global aspect for the adainit and adafinal procedures via a pragma instead of via an aspect_specification.
2022-09-26ada: Document support for the mold linkerKévin Le Gouguec2-8/+30
gcc/ada/ * doc/gnat_ugn/building_executable_programs_with_gnat.rst (Linker Switches): Document support for mold along with gold; add some advice regarding OpenSSL in the Pro version. * gnat_ugn.texi: Regenerate.
2022-09-26ada: Make Original_Aspect_Pragma_Name more preciseTucker Taft1-0/+8
This commit makes Original_Aspect_Pragma_Name more precise in cases where there is a second level of indirection caused by pragmas being turned into Check pragmas. gcc/ada/ * sem_util.adb (Original_Aspect_Pragma_Name): Check for Check pragmas.
2022-09-26ada: Delay expansion of iterator specification in preanalysisPiotr Trojanek1-8/+3
When preanalysing spec expression (e.g. expression of an expression function), the name of iterator specification should not be expanded. This patch simplifies a complicated condition for delaying expansion within quantified expressions and iterated component associations. gcc/ada/ * sem_ch5.adb (Analyze_Iterator_Specification): Delay expansion based on Full_Analysis flag.
2022-09-26ada: Delay expansion of iterated component associationPiotr Trojanek1-4/+5
When preanalysing spec expression (e.g. expression of an expression function), the name of iterator specification within an iterated component association should not be expanded, especially in GNATprove mode. gcc/ada/ * sem_ch5.adb (Analyze_Iterator_Specification): Delay expansion of for iterated component association just like it is done within quantified expression.
2022-09-26ada: Only reject volatile ghost objects when SPARK_Mode is OnPiotr Trojanek1-1/+1
SPARK rule that forbids ghost volatile objects is only affecting proof and not generation of object code. It is now only applied where SPARK_Mode is On. This flexibility is needed to compile code automatically instrumented by GNATcoverage. gcc/ada/ * contracts.adb (Analyze_Object_Contract): Check SPARK_Mode before applying SPARK rule.
2022-09-26ada: Improve accessibility check generationJustin Squirek1-3/+13
Improve accessibility check generation by more precisely identifying cases in which an Original_Node call is needed. Instead of grabbing the Original_Node of a prefix in all cases (since this can cause issues where unanalyzed instance names get referenced) we only obtain the original node when said prefix comes as a result of expanding function calls. gcc/ada/ * sem_util.adb (Accessibility_Level): Modify indexed and selected components case by reducing the scope where Original_Node gets used.
2022-09-26ada: Remove GNATmetric's documentation from GNAT's documentationBoris Yakobowski1-1119/+1
gcc/ada/ * doc/gnat_ugn/gnat_utility_programs.rst: Remove documentation for gnatmetric.
2022-09-26ada: Remove socket definitions for ancient MinGWPiotr Trojanek2-11/+0
Modern MinGW defines _WIN32_WINNT as 0xa00, so there is no need go guard against it being lower than 0x0600 or setting it to 0x0501. gcc/ada/ * gsocket.h: Remove redefinition of _WIN32_WINNT. * mingw32.h: Remove conditional definition of _WIN32_WINNT.
2022-09-26ada: Remove definition of MAXPATHLEN for ancient MinGWPiotr Trojanek1-6/+0
Modern MinGW defines MAXPATHLEN in sys/param.h, so better to use it directly. gcc/ada/ * mingw32.h: Remove condition definition of MAXPATHLEN; the include directive for stdlib.h was most likely intended to provide the MAX_PATH.
2022-09-26ada: Deconstruct build support for ancient MinGWPiotr Trojanek6-49/+5
Remove conditional C code for building GNAT with MinGW earlier than 2.0, which was released in 2007. gcc/ada/ * adaint.c: Remove conditional #include directives for old MinGW. * cal.c: Always include winsock.h, since it is part of modern MinGW. * cstreams.c: Remove workaround for old MinGW. * expect.c: Remove conditional #include directive for old MinGW. * mingw32.h: Remove STD_MINGW and OLD_MINGW declarations. * sysdep.c: Remove conditional #include directive for old MinGW.
2022-09-26ada: Tune comment of routine for detecting junk namesPiotr Trojanek1-6/+3
Reword comment to avoid repetition between spec and body. gcc/ada/ * sem_warn.ads (Has_Junk_Name): Reword comment.
2022-09-26Small tweaks.Eric Botcazou1-6/+6
2022-09-26ranger: remove unused functionMartin Liska1-9/+0
gcc/ChangeLog: * value-range.cc (tree_compare): Remove unused function.
2022-09-26rs6000: Fix the condition with frame_pointer_needed_indeed [PR96072]Kewen Lin2-1/+15
As PR96072 shows, the code adding REG_CFA_DEF_CFA reg note makes one assumption that we have emitted one insn which restores the frame pointer previously. That part of code was guarded with flag frame_pointer_needed before, it was consistent, but it was replaced with flag frame_pointer_needed_indeed since commit r10-7981. It caused ICE due to unexpected NULL insn. PR target/96072 gcc/ChangeLog: * config/rs6000/rs6000-logue.cc (rs6000_emit_epilogue): Update the condition for adding REG_CFA_DEF_CFA reg note with frame_pointer_needed_indeed. gcc/testsuite/ChangeLog: * gcc.target/powerpc/pr96072.c: New test.
2022-09-26testsuite: Fix up avx256-unaligned-store-3.c test.Hu, Lin11-1/+1
gcc/testsuite/ChangeLog: PR target/94962 * gcc.target/i386/avx256-unaligned-store-3.c: Add -mno-avx512f
2022-09-25rs6000: Fix condition of define_expand vec_shr_<mode> [PR100645]Kewen Lin2-1/+14
PR100645 exposes one latent bug in define_expand vec_shr_<mode> that the current condition TARGET_ALTIVEC is too loose. The mode iterator VEC_L contains a few modes, they are not always supported as vector mode, VECTOR_UNIT_ALTIVEC_OR_VSX_P should be used like some other VEC_L usages. PR target/100645 gcc/ChangeLog: * config/rs6000/vector.md (vec_shr_<mode>): Replace condition TARGET_ALTIVEC with VECTOR_UNIT_ALTIVEC_OR_VSX_P. gcc/testsuite/ChangeLog: * gcc.target/powerpc/pr100645.c: New test.
2022-09-26Support 2-instruction vector shuffle for V4SI/V4SF in ↵liuhongt5-0/+373
ix86_expand_vec_perm_const_1. 2022-09-23 Hongtao Liu <hongtao.liu@intel.com> Liwei Xu <liwei.xu@intel.com> gcc/ChangeLog: PR target/53346 * config/i386/i386-expand.cc (expand_vec_perm_shufps_shufps): New function. (ix86_expand_vec_perm_const_1): Insert expand_vec_perm_shufps_shufps at the end of 2-instruction expand sequence. gcc/testsuite/ChangeLog: * gcc.target/i386/pr53346-1.c: New test. * gcc.target/i386/pr53346-2.c: New test. * gcc.target/i386/pr53346-3.c: New test. * gcc.target/i386/pr53346-4.c: New test.
2022-09-26Daily bump.GCC Administrator4-1/+116
2022-09-25fortran: Support clobbering of derived types [PR41453]Mikael Morin2-1/+83
This adds support for clobbering of non-polymorphic derived type variables, when they are passed as actual argument whose associated dummy has the INTENT(OUT) attribute. We avoid to play with non-constant type sizes or class descriptors by requiring that the types are derived (not class) and strictly matching, and by excluding parameterized derived types. Types that are used in the callee are also excluded: they are types with allocatable components (the components will be deallocated), and finalizable types or types with finalizable components (they will be passed to finalization routines). PR fortran/41453 gcc/fortran/ChangeLog: * trans-expr.cc (gfc_conv_procedure_call): Allow strictly matching derived types. gcc/testsuite/ChangeLog: * gfortran.dg/intent_optimize_10.f90: New test.
2022-09-25fortran: Support clobbering of allocatables and pointers [PR41453]Mikael Morin2-2/+42
This adds support for clobbering of allocatable and pointer scalar variables passed as actual argument to a subroutine when the associated dummy has the INTENT(OUT) attribute. Support was explicitly disabled (since the beginning for pointers, since r11-7315-g2df374b337a5f6cf5528e91718e4e12e4006b7ae for allocatables), but the clobber generation code seems to support it well, as demonstrated by the newly added testcase. PR fortran/41453 PR fortran/99169 gcc/fortran/ChangeLog: * trans-expr.cc (gfc_conv_procedure_call): Remove conditions on ALLOCATABLE and POINTER attributes guarding clobber generation. gcc/testsuite/ChangeLog: * gfortran.dg/intent_optimize_9.f90: New test.
2022-09-25fortran: Support clobbering of ASSOCIATE variables [PR41453]Mikael Morin2-1/+45
This is in spirit a revert of: r9-3051-gc109362313623d83fe0a5194bceaf994cf0c6ce0 That commit added a condition to avoid generating ICE with clobbers of ASSOCIATE variables. The test added at that point continues to pass if we remove that condition now. PR fortran/41453 PR fortran/87401 gcc/fortran/ChangeLog: * trans-expr.cc (gfc_conv_procedure_call): Remove condition disabling clobber generation for ASSOCIATE variables. gcc/testsuite/ChangeLog: * gfortran.dg/intent_optimize_8.f90: New test.
2022-09-25fortran: Support clobbering of SAVE variables [PR41453]Mikael Morin2-2/+45
This removes a condition added in: r9-3032-gee7fb0588c6361b4d77337ab0f7527be64fcdde2. That commit added a condition to avoid generating ICE with clobbers of variables with the SAVE attribute. The test added at that point continues to pass if we remove that condition now. PR fortran/41453 PR fortran/87395 gcc/fortran/ChangeLog: * trans-expr.cc (gfc_conv_procedure_call): Remove condition on SAVE attribute guarding clobber generation. gcc/testsuite/ChangeLog: * gfortran.dg/intent_optimize_7.f90: New test.
2022-09-25fortran: Support clobbering of reference variables [PR41453]Mikael Morin2-4/+34
This adds support for clobbering of variables passed by reference, when the reference is forwarded to a subroutine as actual argument whose associated dummy has the INTENT(OUT) attribute. This was explicitly disabled by a condition added with r9-3032-gee7fb0588c6361b4d77337ab0f7527be64fcdde2 and removing that condition seems to work, as demonstrated by the new testcase. PR fortran/41453 PR fortran/87395 gcc/fortran/ChangeLog: * trans-expr.cc (gfc_conv_procedure_call): Remove condition disabling clobber generation for dummy variables. Remove obsolete comment. gcc/testsuite/ChangeLog: * gfortran.dg/intent_optimize_6.f90: New test.
2022-09-25fortran: Support clobbering with implicit interfaces [PR105012]Harald Anlauf2-4/+39
Before procedure calls, we clobber actual arguments whose associated dummy is INTENT(OUT). This only applies to procedures with explicit interfaces, as the knowledge of the interface is necessary to know whether an argument has the INTENT(OUT) attribute. This change also enables clobber generation for procedure calls without explicit interface, when the procedure has been defined in the same file because we can use the dummy arguments' characteristics from the procedure definition in that case. The knowledge of the dummy characteristics is directly available through gfc_actual_arglist’s associated_dummy pointers which have been populated as a side effect of calling gfc_check_externals. PR fortran/105012 gcc/fortran/ChangeLog: * trans-expr.cc (gfc_conv_procedure_call): Use dummy information from associated_dummy if there is no information from the procedure interface. gcc/testsuite/ChangeLog: * gfortran.dg/intent_optimize_5.f90: New test. Co-Authored-By: Mikael Morin <mikael@gcc.gnu.org>
2022-09-25fortran: Move clobbers after evaluation of all arguments [PR106817]Mikael Morin2-2/+47
For actual arguments whose dummy is INTENT(OUT), we used to generate clobbers on them at the same time we generated the argument reference for the function call. This was wrong if for an argument coming later, the value expression was depending on the value of the just- clobbered argument, and we passed an undefined value in that case. With this change, clobbers are collected separatedly and appended to the procedure call preliminary code after all the arguments have been evaluated. PR fortran/106817 gcc/fortran/ChangeLog: * trans-expr.cc (gfc_conv_procedure_call): Collect all clobbers to their own separate block. Append the block of clobbers to the procedure preliminary block after the argument evaluation codes for all the arguments. gcc/testsuite/ChangeLog: * gfortran.dg/intent_optimize_4.f90: New test.
2022-09-25fortran: Fix invalid function decl clobber ICE [PR105012]Mikael Morin2-1/+29
The fortran frontend, as result symbol for a function without declared result symbol, uses the function symbol itself. This caused an invalid clobber of a function decl to be emitted, leading to an ICE, whereas the intended behaviour was to clobber the function result variable. This change fixes the problem by getting the decl from the just-retrieved variable reference after the call to gfc_conv_expr_reference, instead of copying it from the frontend symbol. PR fortran/105012 gcc/fortran/ChangeLog: * trans-expr.cc (gfc_conv_procedure_call): Retrieve variable from the just calculated variable reference. gcc/testsuite/ChangeLog: * gfortran.dg/intent_out_15.f90: New test.
2022-09-25fortran: Move the clobber generation codeMikael Morin2-30/+33
This change inlines the clobber generation code from gfc_conv_expr_reference to the single caller from where the add_clobber flag can be true, and removes the add_clobber argument. What motivates this is the standard making the procedure call a cause for a variable to become undefined, which translates to a clobber generation, so clobber generation should be closely related to procedure call generation, whereas it is rather orthogonal to variable reference generation. Thus the generation of the clobber feels more appropriate in gfc_conv_procedure_call than in gfc_conv_expr_reference. Behaviour remains unchanged. gcc/fortran/ChangeLog: * trans.h (gfc_conv_expr_reference): Remove add_clobber argument. * trans-expr.cc (gfc_conv_expr_reference): Ditto. Inline code depending on add_clobber and conditions controlling it ... (gfc_conv_procedure_call): ... to here.
2022-09-25Fix typo in chapter level for RISC-V attributesTorbjörn SVENSSON1-1/+1
The "RISC-V specific attributes" section should be at the same level as "PowerPC-specific attributes". gcc/ChangeLog: * doc/sourcebuild.texi: Fix chapter level. Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
2022-09-25Daily bump.GCC Administrator4-1/+29
2022-09-24openmp: 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.
2022-09-24openmp, c: Tighten up c_tree_equal [PR106981]Jakub Jelinek2-6/+19
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.
2022-09-24Daily bump.GCC Administrator5-1/+220
2022-09-23testsuite: Add more C2x testsJoseph Myers3-0/+1062
There are some new requirements in C2x where GCC already behaves as required (for all standard versions), where previous standard versions either had weaker requirements permitting the GCC behavior, or were arguably defective in what they said in that area. Add tests that specifically verify GCC behaves as expected for C2x. (There may be further such tests to be added in future for already-supported C2x features.) * Compound literals in function parameter lists have automatic storage duration. (This is a case where strictly this wasn't specified by previous standard versions, but it seems to make more sense to treat this as a defect in those versions than to implement something different conditionally for those versions.) * Concatenation of string literals with different prefixes is a constraint violation (previously it was implementation-defined whether it was permitted, and GCC did not permit it). * UCNs above 0x10ffff are a constraint violation; previously they were implicitly undefined behavior by virtue of wording about "designates the character" referring to code points outside the ISO/IEC 10646 range; GCC diagnosed such UCNs since commit 0900e29cdbc533fecf2a311447bbde17f101bbd6 (Sep 2019). The test I added also has more detailed coverage of what lower-valued UCNs are accepted. Tested for x86_64-pc-linux-gnu. * gcc.dg/c2x-complit-1.c, gcc.dg/c2x-concat-1.c, gcc.dg/cpp/c2x-ucn-1.c: New tests.
2022-09-23testsuite: Skip intrinsics test if armTorbjörn SVENSSON3-3/+3
In the test cases, it's clearly written that intrinsics is not implemented on arm*. A simple xfail does not help since there are link error and that would cause an UNRESOLVED testcase rather than XFAIL. By changing to dg-skip-if, the entire test case is omitted. gcc/testsuite/ChangeLog: * gcc.target/aarch64/advsimd-intrinsics/vld1x2.c: Replace dg-xfail-if with dg-skip-if. * gcc.target/aarch64/advsimd-intrinsics/vld1x3.c: Likewise. * gcc.target/aarch64/advsimd-intrinsics/vld1x4.c: Likewise. Co-Authored-By: Yvan ROUX <yvan.roux@foss.st.com> Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
2022-09-23c++: Implement __is_{nothrow_,}convertible [PR106784]Marek Polacek14-0/+680
To improve compile times, the C++ library could use compiler built-ins rather than implementing std::is_convertible (and _nothrow) as class templates. This patch adds the built-ins. We already have __is_constructible and __is_assignable, and the nothrow forms of those. Microsoft (and clang, for compatibility) also provide an alias called __is_convertible_to. I did not add it, but it would be trivial to do so. I noticed that our __is_assignable doesn't implement the "Access checks are performed as if from a context unrelated to either type" requirement, therefore std::is_assignable / __is_assignable give two different results here: class S { operator int(); friend void g(); // #1 }; void g () { // #1 doesn't matter static_assert(std::is_assignable<int&, S>::value, ""); static_assert(__is_assignable(int&, S), ""); } This is not a problem if __is_assignable is not meant to be used by the users. This patch doesn't make libstdc++ use the new built-ins, but I had to rename a class otherwise its name would clash with the new built-in. PR c++/106784 gcc/c-family/ChangeLog: * c-common.cc (c_common_reswords): Add __is_convertible and __is_nothrow_convertible. * c-common.h (enum rid): Add RID_IS_CONVERTIBLE and RID_IS_NOTHROW_CONVERTIBLE. gcc/cp/ChangeLog: * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_CONVERTIBLE and CPTK_IS_NOTHROW_CONVERTIBLE. * cp-objcp-common.cc (names_builtin_p): Handle RID_IS_CONVERTIBLE RID_IS_NOTHROW_CONVERTIBLE. * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_CONVERTIBLE and CPTK_IS_NOTHROW_CONVERTIBLE. (is_convertible): Declare. (is_nothrow_convertible): Likewise. * cxx-pretty-print.cc (pp_cxx_trait_expression): Handle CPTK_IS_CONVERTIBLE and CPTK_IS_NOTHROW_CONVERTIBLE. * method.cc (is_convertible): New. (is_nothrow_convertible): Likewise. * parser.cc (cp_parser_primary_expression): Handle RID_IS_CONVERTIBLE and RID_IS_NOTHROW_CONVERTIBLE. (cp_parser_trait_expr): Likewise. * semantics.cc (trait_expr_value): Handle CPTK_IS_CONVERTIBLE and CPTK_IS_NOTHROW_CONVERTIBLE. (finish_trait_expr): Likewise. libstdc++-v3/ChangeLog: * include/std/type_traits: Rename __is_nothrow_convertible to __is_nothrow_convertible_lib. * testsuite/20_util/is_nothrow_convertible/value_ext.cc: Likewise. gcc/testsuite/ChangeLog: * g++.dg/ext/has-builtin-1.C: Enhance to test __is_convertible and __is_nothrow_convertible. * g++.dg/ext/is_convertible1.C: New test. * g++.dg/ext/is_convertible2.C: New test. * g++.dg/ext/is_nothrow_convertible1.C: New test. * g++.dg/ext/is_nothrow_convertible2.C: New test.
2022-09-23RISC-V: make USE_LOAD_ADDRESS_MACRO easier to understandVineet Gupta1-6/+7
The current macro has several && and || making it really hard to understand the first time. Signed-off-by: Vineet Gupta <vineetg@rivosinc.com> gcc/ChangeLog: * config/riscv/riscv.h (LOCAL_SYM_P): New. (USE_LOAD_ADDRESS_MACRO): Simplify by calling LOCAL_SYM_P.
2022-09-23RISC-V: Add RVV machine modes.zhongjuzhe1-0/+141
gcc/ChangeLog: * config/riscv/riscv-modes.def (VECTOR_BOOL_MODE): Add RVV mask modes. (ADJUST_NUNITS): Adjust nunits using riscv_vector_chunks. (ADJUST_ALIGNMENT): Adjust alignment. (ADJUST_BYTESIZE): Adjust bytesize using riscv_vector_chunks. (RVV_MODES): New macro. (VECTOR_MODE_WITH_PREFIX): Add RVV vector modes. (VECTOR_MODES_WITH_PREFIX): Add RVV vector modes.
2022-09-23RISC-V: Support poly move manipulation and selftests.zhongjuzhe8-7/+560
gcc/ChangeLog: * common/config/riscv/riscv-common.cc: Change "static void" to "void". * config.gcc: Add riscv-selftests.o * config/riscv/predicates.md: Allow const_poly_int. * config/riscv/riscv-protos.h (riscv_reinit): New function. (riscv_parse_arch_string): change as exten function. (riscv_run_selftests): New function. * config/riscv/riscv.cc (riscv_cannot_force_const_mem): Don't allow poly into const pool. (riscv_report_v_required): New function. (riscv_expand_op): New function. (riscv_expand_mult_with_const_int): New function. (riscv_legitimize_poly_move): Ditto. (riscv_legitimize_move): New function. (riscv_hard_regno_mode_ok): Add VL/VTYPE register allocation and fix vector RA. (riscv_convert_vector_bits): Fix riscv_vector_chunks configuration for -marh no 'v'. (riscv_reinit): New function. (TARGET_RUN_TARGET_SELFTESTS): New target hook support. * config/riscv/t-riscv: Add riscv-selftests.o. * config/riscv/riscv-selftests.cc: New file. gcc/testsuite/ChangeLog: * selftests/riscv/empty-func.rtl: New test.
2022-09-23tree-optimization/106922 - extend same-val clobber FRERichard Biener2-3/+55
The following extends the skipping of same valued stores to handle an arbitrary number of them as long as they are from the same value (which we now record). That's an obvious extension which allows to optimize the m_engaged member of std::optional more reliably. PR tree-optimization/106922 * tree-ssa-sccvn.cc (vn_reference_lookup_3): Allow an arbitrary number of same valued skipped stores. * g++.dg/torture/pr106922.C: New testcase.
2022-09-23frange: Make the setter taking trees a wrapper.Aldy Hernandez1-17/+14
The frange setter does all its work in trees. This incurs a penalty for the real_value variants because they must wrap their arguments into a tree and pass it to the tree setter, which will then do the opposite. This is leftovers from the irange setter. Even though the we still need constructors taking trees so we can interact with the tree world, there's no sense penalizing the rest of the implementation. Tested on x86-64 Linux. gcc/ChangeLog: * value-range.cc (frange::set): Swap setters such that the one accepting REAL_VALUE_TYPE does all the work.
2022-09-23aarch64: Add Arm Neoverse V2 supportKyrylo Tkachov4-23/+24
This patch adds -mcpu/-mtune support for the Arm Neoverse V2 core. This updates the internal references to "demeter", but leaves "demeter" as an accepted value to -mcpu/-mtune as it appears in the released GCC 12 series. Bootstrapped and tested on aarch64-none-linux-gnu. gcc/ChangeLog: * config/aarch64/aarch64-cores.def (neoverse-v2): New entry. (demeter): Update tunings to neoversev2. * config/aarch64/aarch64-tune.md: Regenerate. * config/aarch64/aarch64.cc (demeter_addrcost_table): Rename to neoversev2_addrcost_table. (demeter_regmove_cost): Rename to neoversev2_addrcost_table. (demeter_advsimd_vector_cost): Rename to neoversev2_advsimd_vector_cost. (demeter_sve_vector_cost): Rename to neoversev2_sve_vector_cost. (demeter_scalar_issue_info): Rename to neoversev2_scalar_issue_info. (demeter_advsimd_issue_info): Rename to neoversev2_advsimd_issue_info. (demeter_sve_issue_info): Rename to neoversev2_sve_issue_info. (demeter_vec_issue_info): Rename to neoversev2_vec_issue_info. Update references to above. (demeter_vector_cost): Rename to neoversev2_vector_cost. (demeter_tunings): Rename to neoversev2_tunings. (aarch64_vec_op_count::rename_cycles_per_iter): Use neoversev2_sve_issue_info instead of demeter_sve_issue_info. * doc/invoke.texi (AArch64 Options): Document neoverse-v2.