aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2019-10-31[AArch64] Split gcc.target/aarch64/sve/vcond_4*Richard Sandiford7-132/+299
vcond_4.c combined too much stuff into one test, so that when we needed to add XFAILs for one set of routines, we lost testing of others that used the same instructions. This patch splits it into four: vcond_4.c: The main test for selects between a vector and a scalar, with all elements having the same size. After Prathamesh's fix for PR91272, we are now guaranteed to use the conditionally-loaded vector as the "then" value and the scalar as the "else" value. vcond_4_zero.c: Like vcond_4.c, but comparing with zero. vcond_4_sel.c: Tests for selects between two scalars, with all elements having the same size. The optimisers can legitimately switch the "then" and "else" order and adjust the comparison to match. vcond_4_costly.c: Like vcnod_4.c, but with mixed element sizes. The sequences tested here will not be the preferred ones once we support mixtures of vector sizes, but it still tests an important code path. This means that vcond_4_run.c now only tests what's left in vcond_4.c, but that seems OK, since the main point was to ensure correct exception behaviour. Similarly it means that vcond_5.c only tests what's left in vcond_4.c, but that too is OK, since the point of the test was to compare the default handling of each comparison in vcond_4.c with the -fno-trapping-math equivalent. 2019-10-31 Richard Sandiford <richard.sandiford@arm.com> gcc/testsuite/ * gcc.target/aarch64/sve/vcond_4.c: Split parts out into... * gcc.target/aarch64/sve/vcond_4_costly.c, * gcc.target/aarch64/sve/vcond_4_sel.c, * gcc.target/aarch64/sve/vcond_4_zero.c: ...these new tests. * gcc.target/aarch64/sve/vcond_4_run.c: Adjust accordingly. * gcc.target/aarch64/sve/vcond_5.c: Likewise. From-SVN: r277682
2019-10-31[AArch64] Split gcc.target/aarch64/sve/reduc_strict_3.cRichard Sandiford8-116/+155
This patch splits gcc.target/aarch64/sve/reduc_strict_3.c into one test per function, so that it's easier to see what each scan is matching and also so that we no longer rely on the number of times that each dump message is printed. The patch also generalises the tests to work with scalable vectors. I think the test probably predates support for variable-length loop-aware SLP. 2019-10-31 Richard Sandiford <richard.sandiford@arm.com> gcc/testsuite/ * gcc.target/aarch64/sve/reduc_strict_3.c: Split all but the first function out into... * gcc.target/aarch64/sve/reduc_strict_4.c, * gcc.target/aarch64/sve/reduc_strict_5.c, * gcc.target/aarch64/sve/reduc_strict_6.c, * gcc.target/aarch64/sve/reduc_strict_7.c, * gcc.target/aarch64/sve/reduc_strict_8.c, * gcc.target/aarch64/sve/reduc_strict_9.c: ...these new tests. Test for scalable vectors instead of 256-bit vectors. From-SVN: r277681
2019-10-31[AArch64] Fix build for non-default languagesRichard Sandiford2-2/+9
The SVE PCS support broke go, D and Ada because those languages don't call TARGET_INIT_BUILTINS. We therefore ended up trying to get the TYPE_MAIN_VARIANT of a null __SVBool_t. We shouldn't really need to apply TYPE_MAIN_VARIANT there anyway, since the ABI-defined types are (and need to be) their own main variants. This patch asserts for that instead. 2019-10-31 Richard Sandiford <richard.sandiford@arm.com> gcc/ * config/aarch64/aarch64-sve-builtins.cc (register_builtin_types): Assert that the type we store in abi_vector_types is its own main variant. (svbool_type_p): Don't apply TYPE_MAIN_VARIANT here. From-SVN: r277680
2019-10-31re PR fortran/92284 (Subroutine with bind(c) attribute causing varied problems)Jakub Jelinek2-3/+9
PR fortran/92284 * gfortran.dg/bind_c_array_params_3_aux.c: Include ../../../libgfortran/ISO_Fortran_binding.h rather than ISO_Fortran_binding.h. From-SVN: r277679
2019-10-31Ensure that gfortran.dg/achar_2.f90 can failTobias Burnus2-1/+5
* gfortran.dg/achar_2.f90: Remove bogus line from last commit. From-SVN: r277678
2019-10-31[arm] Avoid using negative offsets for 'immediate' addresses when compiling ↵Richard Earnshaw2-7/+15
for Thumb2 Thumb2 code now uses the Arm implementation of legitimize_address. That code has a case to handle addresses that are absolute CONST_INT values, which is a common use case in deeply embedded targets (eg: void *p = (void*)0x12345678). Since thumb has very limited negative offsets from a constant, we want to avoid forming a CSE base that will then be used with a negative value. This was reported upstream originally in https://gcc.gnu.org/ml/gcc-help/2019-10/msg00122.html For example, void test1(void) { volatile uint32_t * const p = (uint32_t *) 0x43fe1800; p[3] = 1; p[4] = 2; p[1] = 3; p[7] = 4; p[0] = 6; } With the new code, instead of ldr r3, .L2 subw r2, r3, #2035 movs r1, #1 str r1, [r2] subw r2, r3, #2031 movs r1, #2 str r1, [r2] subw r2, r3, #2043 movs r1, #3 str r1, [r2] subw r2, r3, #2019 movs r1, #4 subw r3, r3, #2047 str r1, [r2] movs r2, #6 str r2, [r3] bx lr We now get ldr r3, .L2 movs r2, #1 str r2, [r3, #2060] movs r2, #2 str r2, [r3, #2064] movs r2, #3 str r2, [r3, #2052] movs r2, #4 str r2, [r3, #2076] movs r2, #6 str r2, [r3, #2048] bx lr * config/arm/arm.c (arm_legitimize_address): Don't form negative offsets from a CONST_INT address when TARGET_THUMB2. From-SVN: r277677
2019-10-31[arm] Pattern match insns for a + ~b + CarryRichard Earnshaw2-0/+40
On ARM, the SBC instruction is defined as Ra - Rb - ~C where C is the carry flag. But -Rb = ~Rb + 1, so this is equivalent to Ra + ~Rb + 1 - ~C which then simplifies to Ra + ~Rb + C which is essentially an add-with-carry with one operand inverted. We can define RTL patterns to match this. In thumb2 we can only match when the operands are both registers, but in Arm state we can also use RSC to match when Rn is either a constant or a shifted operand. This overall simplifies some cases of 64-bit arithmetic, for example, int64_t f (int64_t a, int64_t b) { return a + ~b; } will now compile to MVN R2, R2 ADDS R0, R0, R2 SBC R1, R1, R3 * config/arm/arm.md (add_not_cin): New insn. (add_not_shift_cin): Likewise. From-SVN: r277676
2019-10-31Remove dead code in IPA ICF.Martin Liska3-14/+6
2019-10-31 Martin Liska <mliska@suse.cz> * ipa-icf-gimple.c (func_checker::compare_tree_ssa_label): Remove. * ipa-icf-gimple.h: Remove declaration from compare_tree_ssa_label and compare_memory_operand. From-SVN: r277675
2019-10-31Ensure that gfortran.dg/achar_2.f90 can failTobias Burnus2-0/+10
* gfortran.dg/achar_2.f90: Print 'DONE' and add dg-output. From-SVN: r277674
2019-10-31Improve tests for std::add_pointerJonathan Wakely2-1/+9
The type trait depends on is_void so the tests should check those cases. * testsuite/20_util/add_pointer/value.cc: Check void types. From-SVN: r277672
2019-10-31Remove PR 92268 workaround and fix new test failuresJonathan Wakely4-25/+34
With the compiler bug fixed we can simplify the __sizable concept to use a return-type-requirement again. I also realised it was redundantly re-checking a subset of the sized_sentinel_for requirements. The compiler fix also revealed bugs in two tests which started to fail and are fixed by this patch. * include/bits/range_access.h (__sizable): Rename to __sentinel_size. Remove workaround for PR c++/92268 and remove redundant requirements that are already checked by sized_sentinel_for. * testsuite/std/ranges/access/cend.cc: Fix failures. * testsuite/std/ranges/access/end.cc: Likewise. From-SVN: r277667
2019-10-31Fix handling of arrays in range access customization pointsJonathan Wakely6-46/+164
This combines the overloads for arrays with the non-array overloads, using if-constexpr to choose between the cases, and also enforces the following: - ADL should only be used for class types and enumeration types. - ranges::begin should be ill-formed for rvalue arrays. - ranges::end should be ill-formed for rvalue arrays, unbounded arrays, and arrays of incomplete type. - ranges::size should be ill-formed for unbounded arrays. * include/bits/range_access.h (ranges::begin): Combine array and non-array overloads into one function template. Only use ADL for classes and enums (ranges::end, ranges::size): Likewise. Make unbounded arrays ill-formed. (ranges::rbegin, ranges::rend): Only use ADL for classes and enums. Reformat _S_noexcept() functions to mirror operator() structure. * testsuite/std/ranges/access/begin.cc: Check incomplete array. * testsuite/std/ranges/access/end_neg.cc: New test. * testsuite/std/ranges/access/size.cc: Check array of incomplete type. * testsuite/std/ranges/access/size_neg.cc: New test. From-SVN: r277666
2019-10-31[testsuite] Fix wrong order of dg-additional-optionsAndre Vieira20-38/+60
gcc/testsuite/ChangeLog: 2019-10-31 Andre Vieira <andre.simoesdiasvieira@arm.com> * gcc.target/aarch64/sve/reduc_strict_3.c: Fix option order. * gcc.target/i386/avx-vzeroupper-19.c: Likewise. * gcc.target/i386/avx2-vect-mask-store-move1.c: Likewise. * gcc.target/i386/avx512f-gather-2.c: Likewise. * gcc.target/i386/avx512f-gather-5.c: Likewise. * gcc.target/i386/l_fma_double_1.c: Likewise. * gcc.target/i386/l_fma_double_2.c: Likewise. * gcc.target/i386/l_fma_double_3.c: Likewise. * gcc.target/i386/l_fma_double_4.c: Likewise. * gcc.target/i386/l_fma_double_5.c: Likewise. * gcc.target/i386/l_fma_double_6.c: Likewise. * gcc.target/i386/l_fma_float_1.c: Likewise. * gcc.target/i386/l_fma_float_2.c: Likewise. * gcc.target/i386/l_fma_float_3.c: Likewise. * gcc.target/i386/l_fma_float_4.c: Likewise. * gcc.target/i386/l_fma_float_5.c: Likewise. * gcc.target/i386/l_fma_float_6.c: Likewise. * gcc.target/i386/mask-pack.c: Likewise. * gcc.target/i386/mask-unpack.c: Likewise. From-SVN: r277664
2019-10-31Fortran] PR92284 – gfc_desc_to_cfi_desc fixesTobias Burnus8-26/+116
gcc/fortran/ PR fortran/92284. * trans-expr.c (gfc_conv_gfc_desc_to_cfi_desc): Free CFI descriptor at the end; partial revised revert of Rev. 277502. libgfortran/ PR fortran/92284. * runtime/ISO_Fortran_binding.c (gfc_desc_to_cfi_desc): gcc/testsuite/ PR fortran/92284. * gfortran.dg/bind-c-intent-out.f90: Update expected dump; extend comment. * gfortran.dg/bind_c_array_params_3.f90: New. * gfortran.dg/bind_c_array_params_3_aux.c: New. From-SVN: r277663
2019-10-31configure.ac: Compute and substitute omp_device_properties and ↵Jakub Jelinek18-136/+665
omp_device_property_deps. * configure.ac: Compute and substitute omp_device_properties and omp_device_property_deps. * Makefile.in (generated_files): Add omp-device-properties.h. (omp-general.o): Depend on omp-device-properties.h. (omp_device_properties): New make variable. (omp-device-properties.h, s-omp-device-properties-h, install-omp-device-properties): New goals. (install): Depend on install-omp-device-properties for accelerators. * target.def (TARGET_OMP_DEVICE_KIND_ARCH_ISA): New target hook. * target.h (enum omp_device_kind_arch_isa): New enum. * doc/tm.texi.in: Add placeholder for TARGET_OMP_DEVICE_KIND_ARCH_ISA documentation. * omp-general.c: Include omp-device-properties.h. (omp_max_simt_vf): Expect OFFLOAD_TARGET_NAMES to be separated by colon instead of comma. (omp_offload_device_kind_arch_isa, omp_maybe_offloaded): New functions. (omp_context_selector_matches): Implement device set arch/isa selectors, improve device set kind selector handling. * config/i386/i386-options.h (ix86_omp_device_kind_arch_isa): Declare. * config/i386/i386.c (TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Formatting fix. (TARGET_OMP_DEVICE_KIND_ARCH_ISA): Redefine to ix86_omp_device_kind_arch_isa. * config/i386/i386-options.c (struct ix86_target_opts): Move type definition from ix86_target_string to file scope. (isa2_opts, isa_opts): Moved arrays from ix86_target_string function to file scope. (ix86_omp_device_kind_arch_isa): New function. (ix86_target_string): Moved struct ix86_target_opts, isa2_opts and isa_opts definitions to file scope. * config/i386/t-intelmic (omp-device-properties): New goal. * config/nvptx/t-nvptx (omp-device-properties): Likewise. * config/nvptx/nvptx.c (nvptx_omp_device_kind_arch_isa): New function. (TARGET_OMP_DEVICE_KIND_ARCH_ISA): Redefine to nvptx_omp_device_kind_arch_isa. * configure: Regenerate. * doc/tm.texi: Regenerate. testsuite/ * c-c++-common/gomp/declare-variant-9.c: New test. * c-c++-common/gomp/declare-variant-10.c: New test. From-SVN: r277662
2019-10-31Fortran] PR92277 - Fix assumed-rank array with bind(C)Tobias Burnus4-2/+48
gcc/fortran/ PR fortran/92277 * trans-expr.c (gfc_conv_gfc_desc_to_cfi_desc): Fix DECL_ARTIFICIAL checking. gcc/testsuite/ PR fortran/92277 * fortran.dg/pr92277.f90: New. From-SVN: r277661
2019-10-31re PR middle-end/92231 (ICE in gimple_fold_stmt_to_constant_1)Jakub Jelinek8-5/+40
PR middle-end/92231 * tree.h (fndecl_built_in_p): Use fndecl_built_in_p instead of DECL_BUILT_IN in comment. Remove redundant ()s around return argument. * tree.c (free_lang_data_in_decl): Check if var is FUNCTION_DECL before calling fndecl_built_in_p. * gimple-fold.c (gimple_fold_stmt_to_constant_1): Check if TREE_OPERAND (fn, 0) is a FUNCTION_DECL before calling fndecl_built_in_p on it. lto/ * lto-lang.c (handle_const_attribute): Don't call fndecl_built_in_p on *node that is not FUNCTION_DECL. testsuite/ * gcc.c-torture/compile/pr92231.c: New test. From-SVN: r277660
2019-10-31[vect]Make vect-epilogues-nomask=1 defaultAndre Vieira118-148/+524
This patch turns epilogue vectorization on by default for all targets. The following test strategy was chosen for this: 1) Disable epilogue vectorization for all tests that failed due to scan-tree-dump failures for aarch64, arm and x86_64 inside: - gcc.dg/vect - gcc.target/i386 - gcc.target/aarch6 - gfortran.dg/vect 2) Add the Bugzilla's reported testcase but xfail the scan for "EPILOGUE VECTORIZED" for arm*-*-* as that target does not vectorize the epilogue. gcc/ChangeLog: 2019-10-31 Andre Vieira <andre.simoesdiasvieira@arm.com> * params.def (PARAM_VECT_EPILOGUES_NOMASK): Enable by default. gcc/testsuite/ChangeLog: 2019-10-31 Andre Vieira <andre.simoesdiasvieira@arm.com> * gcc.dg/vect/vect-epilogues.c: New test. * gcc.dg/vect/fast-math-vect-call-1.c: Disable for epilogue vectorization. * gcc.dg/vect/no-fast-math-vect16.c: Likewise. * gcc.dg/vect/no-scevccp-noreassoc-slp-reduc-7.c: Likewise. * gcc.dg/vect/no-scevccp-vect-iv-3.c: Likewise. * gcc.dg/vect/no-section-anchors-vect-31.c: Likewise. * gcc.dg/vect/no-section-anchors-vect-64.c: Likewise. * gcc.dg/vect/no-section-anchors-vect-66.c: Likewise. * gcc.dg/vect/no-section-anchors-vect-68.c: Likewise. * gcc.dg/vect/no-vfa-vect-dv-2.c: Likewise. * gcc.dg/vect/pr33804.c: Likewise. * gcc.dg/vect/pr53773.c: Likewise. * gcc.dg/vect/pr65947-1.c: Likewise. * gcc.dg/vect/pr65947-13.c: Likewise. * gcc.dg/vect/pr65947-14.c: Likewise. * gcc.dg/vect/pr65947-4.c: Likewise. * gcc.dg/vect/pr80631-1.c: Likewise. * gcc.dg/vect/pr80631-2.c: Likewise. * gcc.dg/vect/slp-23.c: Likewise. * gcc.dg/vect/slp-25.c: Likewise. * gcc.dg/vect/slp-reduc-2.c: Likewise. * gcc.dg/vect/slp-reduc-5.c: Likewise. * gcc.dg/vect/slp-reduc-6.c: Likewise. * gcc.dg/vect/slp-reduc-sad-2.c: Likewise. * gcc.dg/vect/slp-widen-mult-half.c: Likewise. * gcc.dg/vect/trapv-vect-reduc-4.c: Likewise. * gcc.dg/vect/vect-103.c: Likewise. * gcc.dg/vect/vect-109.c: Likewise. * gcc.dg/vect/vect-119.c: Likewise. * gcc.dg/vect/vect-24.c: Likewise. * gcc.dg/vect/vect-26.c: Likewise. * gcc.dg/vect/vect-27.c: Likewise. * gcc.dg/vect/vect-29.c: Likewise. * gcc.dg/vect/vect-42.c: Likewise. * gcc.dg/vect/vect-44.c: Likewise. * gcc.dg/vect/vect-48.c: Likewise. * gcc.dg/vect/vect-50.c: Likewise. * gcc.dg/vect/vect-52.c: Likewise. * gcc.dg/vect/vect-54.c: Likewise. * gcc.dg/vect/vect-56.c: Likewise. * gcc.dg/vect/vect-58.c: Likewise. * gcc.dg/vect/vect-60.c: Likewise. * gcc.dg/vect/vect-72.c: Likewise. * gcc.dg/vect/vect-75-big-array.c: Likewise. * gcc.dg/vect/vect-75.c: Likewise. * gcc.dg/vect/vect-77-alignchecks.c: Likewise. * gcc.dg/vect/vect-77-global.c: Likewise. * gcc.dg/vect/vect-78-alignchecks.c: Likewise. * gcc.dg/vect/vect-78-global.c: Likewise. * gcc.dg/vect/vect-89-big-array.c: Likewise. * gcc.dg/vect/vect-89.c: Likewise. * gcc.dg/vect/vect-91.c: Likewise. * gcc.dg/vect/vect-92.c: Likewise. * gcc.dg/vect/vect-96.c: Likewise. * gcc.dg/vect/vect-cond-reduc-3.c: Likewise. * gcc.dg/vect/vect-cond-reduc-4.c: Likewise. * gcc.dg/vect/vect-live-1.c: Likewise. * gcc.dg/vect/vect-live-2.c: Likewise. * gcc.dg/vect/vect-live-3.c: Likewise. * gcc.dg/vect/vect-live-4.c: Likewise. * gcc.dg/vect/vect-live-slp-1.c: Likewise. * gcc.dg/vect/vect-live-slp-2.c: Likewise. * gcc.dg/vect/vect-live-slp-3.c: Likewise. * gcc.dg/vect/vect-multitypes-3.c: Likewise. * gcc.dg/vect/vect-multitypes-4.c: Likewise. * gcc.dg/vect/vect-multitypes-6.c: Likewise. * gcc.dg/vect/vect-peel-1-epilogue.c: Likewise. New test. * gcc.dg/vect/vect-peel-1-src.c: Likewise. New test. * gcc.dg/vect/vect-peel-1.c: Likewise. * gcc.dg/vect/vect-peel-3-epilogue.c: Likewise. New test. * gcc.dg/vect/vect-peel-3-src.c: Likewise. New test. * gcc.dg/vect/vect-peel-3.c: Likewise. * gcc.dg/vect/vect-peel-4-epilogue.c: Likewise. New test. * gcc.dg/vect/vect-peel-4-src.c: Likewise. New test. * gcc.dg/vect/vect-peel-4.c: Likewise. * gcc.dg/vect/vect-reduc-6.c: Likewise. * gcc.dg/vect/vect-reduc-dot-s16a.c: Likewise. * gcc.dg/vect/vect-reduc-dot-s8a.c: Likewise. * gcc.dg/vect/vect-reduc-dot-s8b.c: Likewise. * gcc.dg/vect/vect-reduc-dot-u16b.c: Likewise. * gcc.dg/vect/vect-reduc-dot-u8a.c: Likewise. * gcc.dg/vect/vect-reduc-dot-u8b.c: Likewise. * gcc.dg/vect/vect-reduc-pattern-1a.c: Likewise. * gcc.dg/vect/vect-reduc-pattern-1b-big-array.c: Likewise. * gcc.dg/vect/vect-reduc-pattern-1c-big-array.c: Likewise. * gcc.dg/vect/vect-reduc-pattern-2a.c: Likewise. * gcc.dg/vect/vect-reduc-pattern-2b-big-array.c: Likewise. * gcc.dg/vect/vect-reduc-sad.c: Likewise. * gcc.dg/vect/vect-widen-mult-const-s16.c: Likewise. * gcc.dg/vect/vect-widen-mult-const-u16.c: Likewise. * gcc.dg/vect/vect-widen-mult-half-u8.c: Likewise. * gcc.dg/vect/vect-widen-mult-half.c: Likewise. * gcc.dg/vect/vect-widen-mult-u16.c: Likewise. * gcc.dg/vect/vect-widen-mult-u8-s16-s32.c: Likewise. * gcc.dg/vect/wrapv-vect-reduc-dot-s8b.c: Likewise. * gcc.target/aarch64/sve/reduc_strict_3.c: Likewise. * gcc.target/i386/avx-vzeroupper-19.c: Likewise. * gcc.target/i386/avx2-vect-mask-store-move1.c: Likewise. * gcc.target/i386/avx512f-gather-2.c: Likewise. * gcc.target/i386/avx512f-gather-5.c: Likewise. * gcc.target/i386/l_fma_double_1.c: Likewise. * gcc.target/i386/l_fma_double_2.c: Likewise. * gcc.target/i386/l_fma_double_3.c: Likewise. * gcc.target/i386/l_fma_double_4.c: Likewise. * gcc.target/i386/l_fma_double_5.c: Likewise. * gcc.target/i386/l_fma_double_6.c: Likewise. * gcc.target/i386/l_fma_float_1.c: Likewise. * gcc.target/i386/l_fma_float_2.c: Likewise. * gcc.target/i386/l_fma_float_3.c: Likewise. * gcc.target/i386/l_fma_float_4.c: Likewise. * gcc.target/i386/l_fma_float_5.c: Likewise. * gcc.target/i386/l_fma_float_6.c: Likewise. * gcc.target/i386/mask-pack.c: Likewise. * gcc.target/i386/mask-unpack.c: Likewise. * gfortran.dg/vect/vect-4.f90: Likewise. From-SVN: r277659
2019-10-31Check precondition for std::ssize(const Container&)Jonathan Wakely7-0/+56
This precondition is the subject of a national body comment on the C++20 CD. This just adds a test to ensure we enforce the precondition. Also move existing 24_iterator/range_access*.cc tests to a dedicated directory for the [iterator.range] subclause. * testsuite/24_iterators/range_access*.cc: Move to ... * testsuite/24_iterators/range_access/range_access*.cc: ... here. * testsuite/24_iterators/range_access/range_access_cpp20_neg.cc: New test. From-SVN: r277658
2019-10-31Remove missing usage of cgraph_local_info in arm,bfin and c6x.Martin Liska4-18/+27
2019-10-31 Martin Liska <mliska@suse.cz> * config/arm/arm.c (arm_get_pcs_model): Remove usage of cgraph_local_info and use local_info_node instead. * config/bfin/bfin.c (bfin_load_pic_reg): Likewise. (bfin_function_ok_for_sibcall): Likewise. * config/c6x/c6x.c (c6x_function_ok_for_sibcall): Likewise. (must_reload_pic_reg_p): Likewise. From-SVN: r277657
2019-10-31re PR c++/90947 (Simple lookup table of array of strings is miscompiled)Jakub Jelinek8-76/+97
PR c++/90947 * tree.h (type_initializer_zero_p): Remove. * tree.c (type_initializer_zero_p): Remove. cp/ * cp-tree.h (type_initializer_zero_p): Declare. * decl.c (reshape_init_array_1): Formatting fix. * tree.c (type_initializer_zero_p): New function. Moved from ../tree.c, use next_initializable_field, formatting fix. Return false for TYPE_NON_AGGREGATE_CLASS types. From-SVN: r277656
2019-10-30PR c++/84810 - constraints on lambdasJeff Chapman II7-3/+270
Attached is a patch that adds parsing of the optional requires-clause in a lambda-expression and lambda-declarator. Additionally, shorthand constraints from the template-parameter-list are now actually applied and constrain the synthesized operator(). Previously we were not parsing the requires clauses at all and not saving the shorthand constraints in the place expected by grokfndecl. The trailing requires-clause is now also used to suppress synthesis of the conversion to function pointer for non-capturing non-generic lambdas as per expr.prim.lambda.closure/7. This includes a fix to template_class_depth. Previously it was computing the wrong depth for lambdas in the initializer of a static member of a class template, exhibited by the concepts-lambda4 test which currently fails on trunk. The bug was causing grokfndecl to use the constraints from the template class for the lambda. gcc/cp/ 2019-10-30 Jeff Chapman II <jchapman@lock3software.com> PR c++/84810 - constraints on lambdas * lambda.c (maybe_add_lambda_conv_op): Do not synthesize conversion if the call operator does not satisfy its constraints. * parser.c (cp_parser_lambda_declarator_opt): Parse requires-clause on generic lambdas; combine with shorthand constraints. Parse trailing requires-clause and attach to the synthesized call operator. * pt.c (template_class_depth): Only inspect LAMBDA_TYPE_EXTRA_SCOPE if it is present. This fixes an incorrect depth calculation for lambdas inside the initializer of a static data member of a template class. gcc/testsuite/ 2019-10-30 Jeff Chapman II <jchapman@lock3software.com> PR c++/84810 - constraints on lambdas * g++.dg/cpp2a/concepts-lambda2.C: New test. * g++.dg/cpp2a/concepts-lambda3.C: Ditto. * g++.dg/cpp2a/concepts-lambda4.C: Ditto. * g++.dg/cpp2a/concepts-pr84810.C: Ditto. From-SVN: r277655
2019-10-30PR c++/92268 - hard error satisfying return-type-requirementJason Merrill9-13/+43
Previously we would put the template arguments for the concept-check in a TEMPLATE_ID and then also pass them to constraints_satisfied_p, which meant that we would try to normalize the concept-check with the fully instantiated arguments, leading to sadness. Simply not passing the args to constraints_satisfied_p fixes the problem. I also noticed that we weren't detecting substitution failure in the constraints, but were silently treating it as success. * constraint.cc (type_deducible_p): Check for substitution failure. (diagnose_compound_requirement): Adjust diagnostic. * pt.c (do_auto_deduction): Don't pass cargs to constraints_satisfied_p. From-SVN: r277654
2019-10-31Daily bump.GCC Administrator1-1/+1
From-SVN: r277653
2019-10-30PR c++/91369 - Implement P0784R7: constexpr newJakub Jelinek4-2/+150
PR c++/91369 - Implement P0784R7: constexpr new * constexpr.c (cxx_replaceable_global_alloc_fn): Don't return true for placement new. (cxx_placement_new_fn, is_std_construct_at): New functions. (cxx_eval_call_expression): Allow placement new in std::construct_at. (potential_constant_expression_1): Likewise. * g++.dg/cpp2a/constexpr-new5.C: New test. From-SVN: r277649
2019-10-30typeck.c (decl_in_std_namespace_p): Return true also for decls in inline ↵Jakub Jelinek4-2/+157
namespaces inside of std namespace. * typeck.c (decl_in_std_namespace_p): Return true also for decls in inline namespaces inside of std namespace. * g++.dg/cpp0x/Wpessimizing-move6.C: New test. From-SVN: r277648
2019-10-30re PR c++/92024 (crash in check_local_shadow)Bernd Edlinger7-32/+92
2019-10-30 Bernd Edlinger <bernd.edlinger@hotmail.de> * doc/invoke.texi (-Wshadow, -Wshadow=global -Wshadow=local, -Wshadow=compatible-local): Update documentation. cp: 2019-10-30 Bernd Edlinger <bernd.edlinger@hotmail.de> PR c++/92024 * name-lookup.c (check_local_shadow): Shadowing TYPE_DECLs is always a -Wshadow=compatible-local warning, unless -Wshadow is used. testsuite: 2019-10-30 Bernd Edlinger <bernd.edlinger@hotmail.de> PR c++/92024 * g++.dg/parse/crash70.C: New test. * c-c++-common/Wshadow-1.c: New test. From-SVN: r277643
2019-10-30Fortran] PR 92208 don't use function-result dummy variable as actual argumentTobias Burnus4-1/+51
PR fortran/92208 * trans-array.c (gfc_conv_array_parameter): Only copy string-length backend_decl if expression is not a function. PR fortran/92208 * gfortran.dg/pr92208.f90: New. From-SVN: r277639
2019-10-30* cxx-pretty-print.c (get_fold_operator): Use OVL_OP_INFO.Jason Merrill2-46/+6
From-SVN: r277637
2019-10-30PR c++/92134 - constinit malfunction in static data member.Marek Polacek4-0/+26
I wasn't properly setting LOOKUP_CONSTINIT in grokfield and so we didn't detect a non-const initializer. * decl2.c (grokfield): Set LOOKUP_CONSTINIT. * g++.dg/cpp2a/constinit14.C: New test. From-SVN: r277636
2019-10-30Use if-constexpr instead of overloading for customization pointJonathan Wakely2-15/+30
This combines two of the std::ranges::swap.operator() overloads into a single function template. Using if-constexpr to choose between implementations should give the compiler less work to do than using overloading. * include/std/concepts (std::ranges::swap): Use a single overload for the non-array cases, and switch using if-constexpr. From-SVN: r277635
2019-10-30Fix another compilation error with ClangJonathan Wakely2-1/+4
* include/bits/stl_iterator.h (__normal_iterator::iterator_concept): Guard with __cpp_lib_concepts macro. From-SVN: r277634
2019-10-30Fix some missing/incorrect feature test macrosJonathan Wakely7-2/+121
* include/std/bit (__cpp_lib_bitops): Define. * include/std/version (__cpp_lib_constexpr): Remove. (__cpp_lib_bitops, __cpp_lib_constexpr_dynamic_alloc): Define. * testsuite/26_numerics/bit/header.cc: New test. * testsuite/26_numerics/bit/header-2.cc: New test. * testsuite/20_util/allocator_traits/header.cc: New test. * testsuite/20_util/allocator_traits/header-2.cc: New test. From-SVN: r277633
2019-10-30[C++ PATCH] Feature macros are longNathan Sidwell2-66/+71
https://gcc.gnu.org/ml/gcc-patches/2019-10/msg02157.html * c-cppbuiltin.c (c_cpp_builtins): Add 'L' suffix to feature macros. From-SVN: r277632
2019-10-30Fortran/OpenMP] Don't create "alloc:" for 'target exit data'Tobias Burnus4-0/+144
gcc/ * gimplify.c (gimplify_scan_omp_clauses): Remove FE-generated GOMP_MAP_TO_PSET and GOMP_MAP_POINTER mapping for 'target update' and 'target exit data'. libgomp/ * testsuite/libgomp.fortran/target9.f90: New. From-SVN: r277631
2019-10-30Remove some more using-declarations from namespace __gnu_cxxJonathan Wakely5-37/+40
Similar to some recent patches, this removes using-declarations for names from namespace std, so that they are not redeclared in __gnu_cxx. * include/bits/stl_iterator.h (namespace __gnu_cxx): Remove using-declarations for std::iterator and std::iterator_traits. (__gnu_cxx::__normal_iterator): Qualify iterator_traits. * include/ext/algorithm (namespace __gnu_cxx): Remove using-declarations for std names and qualify those names when used. Also refer to std::min in parentheses to protect against function-like macros. * include/ext/rc_string_base.h: Qualify iterator_traits. * include/ext/sso_string_base.h: Qualify iterator_traits. From-SVN: r277630
2019-10-30Apply C++20 changes to various iterator typesJonathan Wakely22-11/+899
This ensures that __normal_iterator<T*, C> satisfies the contiguous_iterator concept, by defining the iterator_concept member type. Also update vector<bool>'s iterators, reverse_iterator, istreambuf_iterator and ostreambuf_iterator to meet the C++20 requirements. PR libstdc++/92272 * include/bits/stl_bvector.h (_Bit_iterator::pointer) (_Bit_const_iterator::pointer): Define as void for C++20. * include/bits/stl_iterator.h (reverse_iterator::operator->()): Add constraints for C++20. (__normal_iterator::iterator_concept): Define for C++20. * include/bits/streambuf_iterator.h (istreambuf_iterator::pointer): Define as void for C++20. (ostreambuf_iterator::difference_type): Define as ptrdiff_t for C++20. (ostreambuf_iterator::ostreambuf_iterator()): Add default constructor for C++20. * testsuite/23_containers/vector/bool/iterator_c++20.cc: New test. * testsuite/24_iterators/bidirectional/concept.cc: New test. * testsuite/24_iterators/bidirectional/tag.cc: New test. * testsuite/24_iterators/contiguous/concept.cc: New test. * testsuite/24_iterators/contiguous/tag.cc: New test. * testsuite/24_iterators/forward/concept.cc: New test. * testsuite/24_iterators/forward/tag.cc: New test. * testsuite/24_iterators/input/concept.cc: New test. * testsuite/24_iterators/input/tag.cc: New test. * testsuite/24_iterators/istreambuf_iterator/requirements/typedefs.cc: New test. * testsuite/24_iterators/ostreambuf_iterator/requirements/typedefs.cc: New test. * testsuite/24_iterators/output/concept.cc: New test. * testsuite/24_iterators/output/tag.cc: New test. * testsuite/24_iterators/random_access/concept.cc: New test. * testsuite/24_iterators/random_access/tag.cc: New test. * testsuite/24_iterators/range_operations/advance_debug_neg.cc: New test. * testsuite/24_iterators/random_access_iterator/26020.cc: Move to ... * testsuite/24_iterators/operations/26020.cc: ... here. * testsuite/24_iterators/random_access_iterator/ string_vector_iterators.cc: Move to ... * testsuite/24_iterators/random_access/string_vector_iterators.cc: ... here. From-SVN: r277629
2019-10-30Fix typo in preprocessor checkJonathan Wakely2-1/+5
* testsuite/util/testsuite_iterators.h: Fix typo in __cplusplus check. From-SVN: r277628
2019-10-30Edges to interposable calles are possibly_call_in_translation_unit_pMartin Jambor2-1/+7
2019-10-30 Martin Jambor <mjambor@suse.cz> ipa/92278 * cgraph.c (cgraph_edge::possibly_call_in_translation_unit_p): Fix availability comparison. From-SVN: r277627
2019-10-30msp430.c (msp430_expand_helper): Support expansion of calls to __mspabi_mpy* ↵Jozef Lawrynowicz3-14/+110
functions. 2019-10-30 Jozef Lawrynowicz <jozef.l@mittosystems.com> * config/msp430/msp430.c (msp430_expand_helper): Support expansion of calls to __mspabi_mpy* functions. * config/msp430/msp430.md (mulhisi3): New define_expand. (umulhisi3): New define_expand. (*mulhisi3_inline): Use old mulhisi3 define_insn. (*umulhisi3_inline): Use old umulhisi3 define_insn. From-SVN: r277624
2019-10-30msp430.c (msp430_check_index_not_high_mem): New.Jozef Lawrynowicz4-6/+82
gcc/ChangeLog: 2019-10-30 Jozef Lawrynowicz <jozef.l@mittosystems.com> * config/msp430/msp430.c (msp430_check_index_not_high_mem): New. (msp430_check_plus_not_high_mem): New. (msp430_op_not_in_high_mem): Use new functions to check if the operand might be in low memory. Indicate that a 16-bit absolute address is in lower memory. gcc/testsuite/ChangeLog: 2019-10-30 Jozef Lawrynowicz <jozef.l@mittosystems.com> * gcc.target/msp430/mlarge-use-430-insn.c: New test. From-SVN: r277623
2019-10-30Fix a call to ultimate_alias_targetMartin Jambor2-1/+6
2019-10-30 Martin Jambor <mjambor@suse.cz> * ipa-prop.c (ipa_compute_jump_functions_for_bb): Fix the call to ultimate_alias_target. From-SVN: r277622
2019-10-30re PR tree-optimization/92275 (ICE: error: definition in block 11 does not ↵Richard Biener4-23/+70
dominate use in block 15 since r277566) 2019-10-30 Richard Biener <rguenther@suse.de> PR tree-optimization/92275 * tree-vect-loop-manip.c (slpeel_update_phi_nodes_for_loops): Copy all loop-closed PHIs. * gcc.dg/torture/pr92275.c: New testcase. From-SVN: r277621
2019-10-30* g++.dg/gomp/declare-variant-6.C: New test.Jakub Jelinek2-0/+30
From-SVN: r277620
2019-10-30Use const_tree more in IPA ICF.Martin Liska3-19/+26
2019-10-30 Martin Liska <mliska@suse.cz> * ipa-icf-gimple.c (func_checker::compare_ssa_name): Use const_tree as function argument. (func_checker::compare_decl): Likewise. (func_checker::operand_equal_p): Likewise. (func_checker::compare_variable_decl): Likewise. (func_checker::parse_labels): Likewise. * ipa-icf-gimple.h: Likewise. From-SVN: r277619
2019-10-30Remove alias set comparison.Martin Liska6-15/+14
2019-10-30 Martin Liska <mliska@suse.cz> * ipa-icf-gimple.c (func_checker::compatible_types_p): Do not compare alias sets. It's handled by operand_equal_p. 2019-10-30 Martin Liska <mliska@suse.cz> * c-c++-common/Wstringop-truncation-4.c: Disable IPA ICF. * gcc.dg/tree-ssa/pr64910-2.c: Likewise. * gcc.dg/tree-ssa/pr79352.c: Likewise. From-SVN: r277618
2019-10-30Remove comparison for polymorphic types.Martin Liska4-23/+9
2019-10-30 Martin Liska <mliska@suse.cz> * ipa-icf-gimple.c (func_checker::func_checker): Do not initialize m_compare_polymorphic. (func_checker::compare_decl): Do not compare polymorphic types. * ipa-icf-gimple.h (m_compare_polymorphic): Remove. * ipa-icf.c (sem_function::equals_private): Do not call compare_polymorphic_p. From-SVN: r277617
2019-10-30IPA ICF: remove dead codeMartin Liska5-160/+18
2019-10-30 Martin Liska <mliska@suse.cz> * ipa-icf-gimple.c (func_checker::compare_ssa_name): Call compare_operand. (func_checker::compare_memory_operand): Remove. (func_checker::compare_cst_or_decl): Remove. (func_checker::operand_equal_valueize): Do not handle FIELD_DECL. (func_checker::compare_gimple_call): Call compare_operand. (func_checker::compare_gimple_assign): Likewise. * ipa-icf-gimple.h: Remove compare_cst_or_decl. * ipa-icf.c (sem_function::icf_handled_component_p): Remove. * ipa-icf.h (icf_handled_component_p): Remove. From-SVN: r277616
2019-10-30Integrate that for IPA ICF.Martin Liska4-152/+107
2019-10-30 Martin Liska <mliska@suse.cz> * ipa-icf-gimple.c (func_checker::hash_operand): New. (func_checker::compare_cst_or_decl): Remove handling of FIELD_DECL. (func_checker::compare_operand): Transform to ... (func_checker::operand_equal_p): ... this. * ipa-icf-gimple.h (class func_checker): Add operand_equal_p and hash_operand. * ipa-icf.c (sem_function::equals_private): Fix pushing and popping of cfun. From-SVN: r277615
2019-10-30Come up with an abstraction.Martin Liska4-302/+376
2019-10-30 Martin Liska <mliska@suse.cz> * fold-const.c (operand_equal_p): Move to ... (operand_compare::operand_equal_p): ... here. (operand_compare::verify_hash_value): New. (add_expr): Move to ... (operand_compare::hash_operand): ... here. * fold-const.h (operand_equal_p): Move to the class. (class operand_compare): New. * tree.c (add_expr): Remove. From-SVN: r277614