aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-12-05Fix __gcov_exit fn prototype.HEADmasterMartin Liska
2019-12-05 Martin Liska <mliska@suse.cz> PR gcov-profile/92817 * coverage.c (build_gcov_exit_decl): Remove superfluous void_type_node. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@278995 138bc75d-0d04-0410-961f-82ee72b054a4
2019-12-05MSP430: Fix postinc addressing mode being used for dst op of CMP insnsJozef Lawrynowicz
2019-12-05 Jozef Lawrynowicz <jozef.l@mittosystems.com> * config/msp430/msp430.md (cbranch<mode>4): Use msp430_general_dst_nonv_operand instead of nonimmediate_operand for dest operand of CMP instruction. (cbranchpsi4_real): Likewise. (cbranchqi4_real): Likewise. (cbranchhi4_real): Likewise. (cbranchpsi4_reversed): Likewise. (cbranchqi4_reversed): Likewise. (cbranchhi4_reversed): Likewise. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@278994 138bc75d-0d04-0410-961f-82ee72b054a4
2019-12-05Skip test gcc/testsuite/gcc.dg/asm-4.c for amdgcn targetFrederik Harwath
2019-12-05 Frederik Harwath <frederik@codesourcery.com> gcc/testsuite/ * gcc.dg/asm-4.c: Skip on target amdgcn-*-*. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@278993 138bc75d-0d04-0410-961f-82ee72b054a4
2019-12-05 PR target/92055Georg-Johann Lay
* config/avr/t-avrlibc (MULTISUBDIR): Search for double, not double64. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@278992 138bc75d-0d04-0410-961f-82ee72b054a4
2019-12-052019-12-05 Richard Biener <rguenther@suse.de>Richard Biener
PR tree-optimization/92803 * tree-ssa-forwprop.c (simplify_vector_constructor): Fix invariant vector construction. * gcc.target/i386/pr92803.c: New testcase. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@278991 138bc75d-0d04-0410-961f-82ee72b054a4
2019-12-05Fix profile name files without -fprofile-dir.Martin Liska
2019-12-05 Martin Liska <mliska@suse.cz> PR gcov-profile/91971 * coverage.c (coverage_init): Mangle full path only when -fprofile-dir is used. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@278990 138bc75d-0d04-0410-961f-82ee72b054a4
2019-12-05 PR target/92791Jakub Jelinek
* config/i386/i386.md (movstrict<mode>): Move test for TARGET_PARTIAL_REG_STALL and not optimizing for size from expander's condition to the body - FAIL; in that case. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@278989 138bc75d-0d04-0410-961f-82ee72b054a4
2019-12-05 PR fortran/92781Jakub Jelinek
* trans-decl.c (gfc_get_symbol_decl): If sym->backend_decl is current_function_decl, add length to current rather than parent function and expect DECL_CONTEXT (length) to be current_function_decl. * gfortran.dg/pr92781.f90: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@278988 138bc75d-0d04-0410-961f-82ee72b054a4
2019-12-05/gcc/cpPaolo Carlini
2019-12-05 Paolo Carlini <paolo.carlini@oracle.com> * typeck2.c (build_functional_cast): Add location_t parameter and use it. * cp-tree.h: Update declaration. * parser.c (cp_parser_functional_cast): Adjust call. * call.c (build_op_delete_call): Likewise. (build_new_method_call_1): Likewise. * decl.c (check_initializer): Likewise. * pt.c (tsubst_copy_and_build): Likewise. * semantics.c (finish_compound_literal): Likewise. /libcc1 2019-12-05 Paolo Carlini <paolo.carlini@oracle.com> * libcp1plugin.cc (plugin_build_expression_list_expr): Adjust build_functional_cast call. /testsuite 2019-12-05 Paolo Carlini <paolo.carlini@oracle.com> * g++.dg/diagnostic/functional-cast-to-array-type-1.C: New. * g++.dg/cpp0x/auto25.C: Check location(s) too. * g++.dg/cpp0x/auto28.C: Likewise. * g++.dg/init/reference2.C: Likewise. * g++.dg/parse/template2.C: Likewise. * g++.dg/template/error8.C: Likewise. * g++.old-deja/g++.ns/crash3.C: Likewise. * g++.old-deja/g++.ns/template7.C: Likewise. * g++.old-deja/g++.pt/crash8.C: Likewise. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@278987 138bc75d-0d04-0410-961f-82ee72b054a4
2019-12-05testsuite/libgomp.oacc-fortran: Update dg-output to fix GCNTobias Burnus
* testsuite/libgomp.oacc-fortran/error_stop-1.f: Also don't expect dg-output of 'Error termination.' for GCN. * testsuite/libgomp.oacc-fortran/error_stop-2.f: Likewise. * testsuite/libgomp.oacc-fortran/error_stop-3.f: Likewise. Plus: Fix date of a previous commit in: * gcc/fortran/ChangeLog * gcc/testsuite/ChangeLog git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@278986 138bc75d-0d04-0410-961f-82ee72b054a4
2019-12-05 * edtest.c (test1): Add noclone attribute.Ian Lance Taylor
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@278985 138bc75d-0d04-0410-961f-82ee72b054a4
2019-12-05libbacktrace: simplify DWARF section handlingIan Lance Taylor
This is in preparation for adding DWARF 5 support. * internal.h (enum dwarf_section): Define. (struct dwarf_sections): Define. (backtrace_dwarf_add): Update declaration to replace specific section parameters with dwarf_sections parameter. * dwarf.c (struct dwarf_data): Replace specific section fields with dwarf_sections field. (read_attribute): Use dwarf_sections with altlink. (build_address_map): Replace specific section parameters with dwarf_sections parameter. Change all callers. (read_line_info): Use dwarf_sections with ddata. (read_referenced_name): Likewise. (add_function_ranges): Likewise. (read_function_entry): Likewise. (read_function_info): Likewise. (build_dwarf_data): Replace specific section parameters with dwarf_sections parameter. Change all callers. (backtrace_dwarf_add): Likewise. * elf.c (enum debug_section): Remove. (dwarf_section_names): Remove .zdebug names. (elf_add): Track zsections separately. Build dwarf_sections. * pecoff.c (enum debug_section): Remove. (struct debug_section_info): Remove data field. (coff_add): Build dwarf_sections. * xcoff.c (enum dwarf_section): Remove. Replace DWSECT_xxx references with DEBUG_xxx references. (xcoff_add): Build dwarf_sections. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@278984 138bc75d-0d04-0410-961f-82ee72b054a4
2019-12-05PR middle-end/91582 - missing heap overflow detection for strcpyMartin Sebor
gcc/ChangeLog: PR middle-end/91582 * builtins.c (gimple_call_alloc_size): New function. (compute_objsize): Add argument. Call gimple_call_alloc_size. Handle variable offsets and indices. * builtins.h (gimple_call_alloc_size): Declare. (compute_objsize): Add argument. * gcc/gimple-ssa-warn-restrict.c: Remove assertions. * tree-ssa-strlen.c (handle_store): Handle calls to allocated objects. gcc/testsuite/ChangeLog: PR middle-end/91582 * c-c++-common/Wstringop-truncation.c: Remove xfails. * g++.dg/warn/Wstringop-overflow-4.C: New test. * g++.dg/ext/attr-alloc_size.C: Suppress -Warray-bounds. * gcc.dg/Warray-bounds-56.c: New test. * gcc.dg/Wstringop-overflow-22.c: New test. * gcc.dg/attr-alloc_size.c: Suppress -Warray-bounds. * gcc.dg/attr-copy-2.c: Same. * gcc.dg/builtin-stringop-chk-5.c: Remove xfails. * gcc.dg/builtin-stringop-chk-8.c: Same. Correct the text of expected warnings. * gcc.target/i386/pr82002-2a.c: Prune expected warning. * gcc.target/i386/pr82002-2b.c: Same. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@278983 138bc75d-0d04-0410-961f-82ee72b054a4
2019-12-05libstdc++: Define pretty printer for comparison categoriesJonathan Wakely
* python/libstdcxx/v6/printers.py (StdCmpCatPrinter): New printer. * testsuite/libstdc++-prettyprinters/cxx20.cc: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@278982 138bc75d-0d04-0410-961f-82ee72b054a4
2019-12-05libstdc++: Implement spaceship for std::array (P1614R2)Jonathan Wakely
As done for std::pair, this defines operator<=> as a non-member function template and does not alter operator==, as expected to be proposed as the resolution to an unpublished LWG issue. Instead of calling std::lexicographical_compare_three_way the <=> overload is implemented by hand to take advantage of the fact the element types and array sizes are known to be the same. * include/bits/cpp_type_traits.h (__is_byte<char8_t>): Add specialization. * include/std/array (operator<=>): Likewise. * testsuite/23_containers/array/comparison_operators/constexpr.cc: Test three-way comparisons and arrays of unsigned char. * testsuite/23_containers/array/tuple_interface/get_neg.cc: Adjust dg-error line numbers. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@278981 138bc75d-0d04-0410-961f-82ee72b054a4
2019-12-05Daily bump.GCC Administrator
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@278980 138bc75d-0d04-0410-961f-82ee72b054a4
2019-12-04Fix C handling of use of lvalues of incomplete types (PR c/36941, PR c/88827).Joseph Myers
Bug 88827 points out that GCC should not be rejecting C code that dereferences a pointer to an incomplete type in the case that uses &* to take the address of the resulting lvalue, because no constraint is violated in that case (other than for C90 when the incomplete type is unqualified void, which we already handle correctly) and as the lvalue never gets converted to an rvalue there is no undefined behavior either. This means that the diagnostic for such a dereference is bogus and should be removed; if the lvalue gets converted to an rvalue, there should be an appropriate error later for the use of the incomplete type. In most cases, there is, but bug 36941 points out the lack of a diagnostic when the incomplete (non-void) type gets cast to void (where a diagnostic seems appropriate for this undefined behavior as a matter of quality of implementation). This patch removes the bogus diagnostic (and C_TYPE_ERROR_REPORTED which was only used in the code that is removed - only that one, bogus diagnostic had this duplicate suppression, not any of the other, more legitimate diagnostics for use of incomplete types) and makes convert_lvalue_to_rvalue call require_complete_type for arguments not of void types, so that all relevant code paths (possibly except some for ObjC) get incomplete types diagnosed. It's possible that this makes some other checks for incomplete types obsolete, but no attempt is made to remove any such checks. Bootstrapped with no regressions for x86_64-pc-linux-gnu. PR c/36941 PR c/88827 gcc/c: * c-typeck.c (convert_lvalue_to_rvalue): Call require_complete_type for arguments not of void types. (build_indirect_ref): Do not diagnose dereferencing pointers to incomplete types. * c-tree.h (C_TYPE_ERROR_REPORTED): Remove. gcc/testsuite: * gcc.dg/lvalue-9.c, gcc.dg/lvalue-10.c: New tests. * gcc.dg/array-8.c, gcc.dg/enum-incomplete-1.c, gcc.dg/enum-incomplete-3.c, gcc.dg/noncompile/incomplete-3.c, gcc.dg/pr48552-1.c, gcc.dg/pr48552-2.c, gcc.dg/pr63543.c, gcc.dg/pr69796.c: Update expected diagnostics. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@278976 138bc75d-0d04-0410-961f-82ee72b054a4
2019-12-04 * cp-gimplify.c: Include tm_p.h.David Edelsohn
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@278975 138bc75d-0d04-0410-961f-82ee72b054a4
2019-12-04Use fixed registers for queue ptr sgpr pairJulian Brown
gcc/ * config/gcn/gcn.h (FIXED_REGISTERS): Make s6/s7 fixed registers. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@278974 138bc75d-0d04-0410-961f-82ee72b054a4
2019-12-04Do not define builtins that overload disabled builtins.Peter Bergner
PR bootstrap/92661 * config/rs6000/rs6000-c.c (struct altivec_builtin_types): Move to rs6000.h. (altivec_overloaded_builtins): Move to rs6000-call.c. * config/rs6000/rs6000.h (struct altivec_builtin_types): Moved from rs6000-c.c. * config/rs6000/rs6000-call.c (rs6000_builtin_info): Make static. (altivec_overloaded_builtins): Moved from rs6000-c.c. (rs6000_common_init_builtins): Do no define builtins that overload builtins that have been disabled. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@278973 138bc75d-0d04-0410-961f-82ee72b054a4
2019-12-04[ARM] Improve max_cond_insns setting for Cortex coresWilco Dijkstra
To enable cores to use the correct max_cond_insns setting, use the core-specific tuning when a CPU/tune is selected unless -mrestrict-it is explicitly set. On Cortex-A57 this gives 1.1% performance gain on SPECINT2006 as well as a 0.4% codesize reduction. gcc/ * config/arm/arm.c (arm_option_override_internal): Use max_cond_insns from CPU tuning unless -mrestrict-it is used. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@278968 138bc75d-0d04-0410-961f-82ee72b054a4
2019-12-04Remove stray comma in primary_constraint_error.Marek Polacek
* parser.c (enum primary_constraint_error): Remove stray comma. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@278967 138bc75d-0d04-0410-961f-82ee72b054a4
2019-12-04[AArch64] Add support for fused compare and branchWilco Dijkstra
Add support for fused compare with branch. Rename the existing AARCH64_FUSE_CMP_BRANCH to ALU_BRANCH, and AARCH64_FUSE_ALU_BRANCH to ALU_CBZ to make it clear what is being fused. gcc/ * config/aarch64/aarch64.c (thunderxt88_tunings): Use AARCH64_FUSE_ALU_BRANCH. (thunderx_tunings): Likewise. (tsv110_tunings): Use AARCH64_FUSE_ALU_BRANCH and AARCH64_FUSE_ALU_CBZ. (thunderx2t99_tunings): Likewise. (aarch_macro_fusion_pair_p): Add support for AARCH64_FUSE_CMP_BRANCH. * config/aarch64/aarch64-fusion-pairs.def: Add ALU_CBZ fusion. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@278966 138bc75d-0d04-0410-961f-82ee72b054a4
2019-12-042019-12-04 Richard Biener <rguenther@suse.de>Richard Biener
* tree-ssa-sccvn.c (vn_reference_lookup_3): Properly guard empty CTOR and memset partial-def registering. Take advantage of fancy offset analysis in memset handling. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@278965 138bc75d-0d04-0410-961f-82ee72b054a4
2019-12-04Fix VIEW_CONVERT_EXPRs for VECTOR_BOOLEAN_TYPE_PsRichard Sandiford
In r278410 I added code to handle VIEW_CONVERT_EXPRs between variable-length vectors. This included support for decoding a VECTOR_BOOLEAN_TYPE_P with subbyte elements. However, it turns out that we were already mishandling such bool vectors for fixed-length vectors: we treated each element as a stand-alone byte instead of putting multiple elements into the same byte. I think in principle this could have been an issue for AVX512 as well. This patch adds encoding support for boolean vectors and reuses a version of the new decode support for fixed-length vectors. 2019-12-04 Richard Sandiford <richard.sandiford@arm.com> gcc/ * fold-const.c (native_encode_vector_part): Handle VECTOR_BOOLEAN_TYPE_Ps that have subbyte precision. (native_decode_vector_tree): Delete, moving the bulk of the code to... (native_interpret_vector_part): ...this new function. Use a pointer and length instead of a vec<> and start index. (native_interpret_vector): Use native_interpret_vector_part. (fold_view_convert_vector_encoding): Likewise. gcc/testsuite/ * gcc.target/aarch64/sve/acle/general/whilelt_5.c: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@278964 138bc75d-0d04-0410-961f-82ee72b054a4
2019-12-042019-12-04 Richard Biener <rguenther@suse.de>Richard Biener
* tree-ssa-sccvn.c (vn_walk_cb_data::push_partial_def): Handle non-constant defs in the most trivial way. (vn_reference_lookup_3): Also push down SSA partial defs. * gcc.dg/tree-ssa/ssa-fre-84.c: New testcase. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@278963 138bc75d-0d04-0410-961f-82ee72b054a4
2019-12-04Fortran] PR92754 - fix an issue with resolving intrinsic functionsTobias Burnus
gcc/fortran/ PR fortran/92754 * intrinsic.c (gfc_intrinsic_func_interface): Set sym's flavor, intrinsic and function attribute if unset. gcc/testsuite/ PR fortran/92754 gfortran.dg/intrinsic_9.f90: New. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@278961 138bc75d-0d04-0410-961f-82ee72b054a4
2019-12-04Initialize a BB count in switch lowering.Martin Liska
2019-12-04 Martin Liska <mliska@suse.cz> * tree-switch-conversion.c (switch_decision_tree::try_switch_expansion): Initialize count of newly created BB. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@278959 138bc75d-0d04-0410-961f-82ee72b054a4
2019-12-04 PR tree-optimization/92734Jakub Jelinek
* match.pd ((A +- B) - A -> +- B, (A +- B) -+ B -> A, A - (A +- B) -> -+ B, A +- (B -+ A) -> +- B): Handle nop_convert. * gcc.dg/tree-ssa/pr92734-2.c: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@278958 138bc75d-0d04-0410-961f-82ee72b054a4
2019-12-04[C++] Opt out of GNU vector extensions for built-in SVE typesRichard Sandiford
This is the C++ equivalent of r277950. The changes are very similar to there. Perhaps the only noteworthy thing (that I know of) is that the patch continues to treat !gnu_vector_type_p vector types as literal types/potential constexprs. Disabling the GNU vector extensions shouldn't in itself stop the types from being literal types, since whatever the target provides instead might be constexpr material. 2019-12-04 Richard Sandiford <richard.sandiford@arm.com> gcc/cp/ * cp-tree.h (CP_AGGREGATE_TYPE_P): Check for gnu_vector_type_p instead of VECTOR_TYPE. * call.c (build_conditional_expr_1): Restrict vector handling to vectors that satisfy gnu_vector_type_p. * cvt.c (ocp_convert): Only allow vectors to be converted to bool if they satisfy gnu_vector_type_p. (build_expr_type_conversion): Only allow conversions from vectors if they satisfy gnu_vector_type_p. * typeck.c (cp_build_binary_op): Only allow binary operators to be applied to vectors if they satisfy gnu_vector_type_p. (cp_build_unary_op): Likewise unary operators. (build_reinterpret_cast_1): gcc/testsuite/ * g++.target/aarch64/sve/acle/general-c++/gnu_vectors_1.C: New test. * g++.target/aarch64/sve/acle/general-c++/gnu_vectors_2.C: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@278957 138bc75d-0d04-0410-961f-82ee72b054a4
2019-12-04 PR fortran/92756Jakub Jelinek
* trans-openmp.c (gfc_trans_omp_teams): Wrap OMP_TEAMS body into a BIND_EXPR with a forced BLOCK. * gfortran.dg/gomp/teams1.f90: New test. * testsuite/libgomp.fortran/teams1.f90: New test. * testsuite/libgomp.fortran/teams2.f90: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@278956 138bc75d-0d04-0410-961f-82ee72b054a4
2019-12-04[rs6000] Fix PR92760 by checking VECTOR_MEM_NONE_P insteadKewen Lin
PR92760 exposed one issue that VECTOR_UNIT_NONE_P (V2DImode) is true on Power7 then we won't return it as preferred_simd_mode but ISA 2.06 (Power7) does introduce partial support on vector doubleword (very limitted) and more basic support origins from ISA 2.07 (Power8) though. To make vectorizer still leverage those few but available V2DImode related instructions, we need to claim it's available on VSX (Power7 and up). gcc/ChangeLog PR target/92760 * gcc/config/rs6000/rs6000.c (rs6000_preferred_simd_mode): Use VECTOR_MEM_NONE_P instead of VECTOR_UNIT_NONE_P. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@278955 138bc75d-0d04-0410-961f-82ee72b054a4
2019-12-04Daily bump.GCC Administrator
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@278954 138bc75d-0d04-0410-961f-82ee72b054a4
2019-12-03libstdc++: Implement spaceship for std::pair (P1614R2)Jonathan Wakely
This defines operator<=> as a non-member function template and does not alter operator==. This contradicts the changes made by P1614R2, which specify both as hidden friends, but that specification of operator<=> is broken and the subject of a soon-to-be-published LWG issue. * include/bits/stl_pair.h [__cpp_lib_three_way_comparison] (operator<=>): Define for C++20. * libsupc++/compare (__cmp2way_res_t): Rename to __cmp3way_res_t, move into __detail namespace. Do not turn argument types into lvalues. (__cmp3way_helper): Rename to __cmp3way_res_impl, move into __detail namespace. Constrain with concepts instead of using void_t. (compare_three_way_result): Adjust name of base class. (compare_three_way_result_t): Use __cmp3way_res_impl directly. (__detail::__3way_cmp_with): Add workaround for PR 91073. (compare_three_way): Use workaround. (__detail::__synth3way, __detail::__synth3way_t): Define new helpers implementing synth-three-way and synth-three-way-result semantics. * testsuite/20_util/pair/comparison_operators/constexpr_c++20.cc: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@278951 138bc75d-0d04-0410-961f-82ee72b054a4
2019-12-03libstdc++: Fix Doxygen markup errorJonathan Wakely
* include/bits/stl_pair.h (pair): Remove stray Doxygen closing marker. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@278950 138bc75d-0d04-0410-961f-82ee72b054a4
2019-12-03 * cp-tree.h (enum cp_tree_index): Add CPTI_SOURCE_LOCATION_IMPL.Jakub Jelinek
(source_location_impl): Define. (enum cp_built_in_function): Add CP_BUILT_IN_SOURCE_LOCATION. (fold_builtin_source_location): Declare. * cp-gimplify.c: Include output.h, file-prefix-map.h and cgraph.h. (cp_gimplify_expr, cp_fold): Handle CP_BUILT_IN_SOURCE_LOCATION. Formatting fix. (get_source_location_impl_type): New function. (struct source_location_table_entry, struct source_location_table_entry_hash): New types. (source_location_table, source_location_id): New variables. (fold_builtin_source_location): New function. * constexpr.c (cxx_eval_builtin_function_call): Handle CP_BUILT_IN_SOURCE_LOCATION. * tree.c (builtin_valid_in_constant_expr_p): Likewise. Formatting fix. * decl.c (cxx_init_decl_processing): Register __builtin_source_location. * name-lookup.c (get_std_name_hint): Add source_location entry. * g++.dg/cpp2a/srcloc1.C: New test. * g++.dg/cpp2a/srcloc2.C: New test. * g++.dg/cpp2a/srcloc3.C: New test. * g++.dg/cpp2a/srcloc4.C: New test. * g++.dg/cpp2a/srcloc5.C: New test. * g++.dg/cpp2a/srcloc6.C: New test. * g++.dg/cpp2a/srcloc7.C: New test. * g++.dg/cpp2a/srcloc8.C: New test. * g++.dg/cpp2a/srcloc9.C: New test. * g++.dg/cpp2a/srcloc10.C: New test. * g++.dg/cpp2a/srcloc11.C: New test. * g++.dg/cpp2a/srcloc12.C: New test. * g++.dg/cpp2a/srcloc13.C: New test. * g++.dg/cpp2a/srcloc14.C: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@278949 138bc75d-0d04-0410-961f-82ee72b054a4
2019-12-03 PR bootstrap/92783Eric Botcazou
* gcc-interface/utils.c (rest_of_record_type_compilation): Move down the guard for the position of fields in the descriptive type. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@278948 138bc75d-0d04-0410-961f-82ee72b054a4
2019-12-03/cpPaolo Carlini
2019-12-03 Paolo Carlini <paolo.carlini@oracle.com> * typeck.c (cp_build_addr_expr_1): Use the cp_expr_loc_or_input_loc location in a few additional diagnostics; tidy. (check_return_expr): Likewise. * typeck.c (cp_build_addr_expr_1): Use tree_strip_any_location_wrapper for the address of main pedwarn. /testsuite 2019-12-03 Paolo Carlini <paolo.carlini@oracle.com> * g++.dg/diagnostic/inconsistent-deduction-1.C: New. * g++.dg/diagnostic/returning-a-value-1.C: Likewise. * g++.dg/cpp0x/decltype3.C: Check location(s) too. * g++.dg/cpp0x/decltype4.C: Likewise. * g++.dg/cpp0x/lambda/lambda-deduce-ext-neg.C: Likewise. * g++.dg/cpp2a/consteval13.C: Likewise. * g++.dg/expr/pmf-1.C: Likewise. * g++.dg/other/ptrmem2.C: Likewise. * g++.dg/template/ptrmem17.C: Likewise. * g++.old-deja/g++.bugs/900213_03.C: Likewise. * g++.old-deja/g++.other/pmf7.C: Likewise. * g++.old-deja/g++.other/ptrmem7.C: Likewise. * g++.dg/diagnostic/main2.C: New. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@278947 138bc75d-0d04-0410-961f-82ee72b054a4
2019-12-03 * ipa-fnsummary.c: Include tree-into-ssa.h.Jan Hubicka
(compute_fn_summary): Call update_ssa. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@278946 138bc75d-0d04-0410-961f-82ee72b054a4
2019-12-03 PR c++/91369Jakub Jelinek
* constexpr.c (struct constexpr_global_ctx): Add cleanups member, initialize it in the ctor. (cxx_eval_constant_expression) <case TARGET_EXPR>: If TARGET_EXPR_SLOT is already in the values hash_map, don't evaluate it again. Put TARGET_EXPR_SLOT into hash_map even if not lval, and push it into save_exprs too. If there is TARGET_EXPR_CLEANUP and not CLEANUP_EH_ONLY, push the cleanup to cleanups vector. <case CLEANUP_POINT_EXPR>: Save outer cleanups, set cleanups to local auto_vec, after evaluating the body evaluate cleanups and restore previous cleanups. <case TRY_CATCH_EXPR>: Don't crash if the first operand is NULL_TREE. (cxx_eval_outermost_constant_expr): Set cleanups to local auto_vec, after evaluating the expression evaluate cleanups. * g++.dg/cpp2a/constexpr-new8.C: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@278945 138bc75d-0d04-0410-961f-82ee72b054a4
2019-12-03Clear calls_comdat_local when comdat group is dissolvedJan Hubicka
while looking into Firefox inlining dumps I noticed that we often do not inline because we think function calls comdat local while the comdat group itself has been dissolved. * cgraph.c (cgraph_node::verify_node): Check that calls_comdat_local is set only for symbol in comdat group. * symtab.c (symtab_node::dissolve_same_comdat_group_1): Clear it. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@278944 138bc75d-0d04-0410-961f-82ee72b054a4
2019-12-03Do not update SSA in lto-stremaer-inJan Hubicka
* cgraph.c: Include tree-into-ssa.h (cgraph_node::get_body): Call update_ssa. * cgraphunit.c (cgraph_node::expand): Likewise. * lto-streamer-in.c (input_function): Do not call update_ssa. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@278943 138bc75d-0d04-0410-961f-82ee72b054a4
2019-12-03Don't install unnecessary ARRAY_REF element sizesRichard Sandiford
Even EXACT_DIV_EXPR doesn't distribute across addition for wrapping types, so in general we can't fold EXACT_DIV_EXPRs of POLY_INT_CSTs at compile time. This was causing an ICE when trying to gimplify the element size field in an ARRAY_REF. If the result of that EXACT_DIV_EXPR is an invariant, we don't bother recording it in the ARRAY_REF and simply read the element size from the element type. This avoids the overhead of doing: /* ??? tree_ssa_useless_type_conversion will eliminate casts to sizetype from another type of the same width and signedness. */ if (TREE_TYPE (aligned_size) != sizetype) aligned_size = fold_convert_loc (loc, sizetype, aligned_size); return size_binop_loc (loc, MULT_EXPR, aligned_size, size_int (TYPE_ALIGN_UNIT (elmt_type))); each time array_ref_element_size is called. So rather than read array_ref_element_size, do some arithmetic on it, and only then check whether the result is an invariant, we might as well check whether the element size is an invariant to start with. We're then directly testing whether array_ref_element_size gives a reusable value. For consistency, the patch makes the same change for the offset field in a COMPONENT_REF, although I don't think that can trigger yet. 2019-12-03 Richard Sandiford <richard.sandiford@arm.com> gcc/ * gimplify.c (gimplify_compound_lval): Don't gimplify and install an array element size if array_element_size is already an invariant. Similarly don't gimplify and install a field offset if component_ref_field_offset is already an invariant. gcc/testsuite/ * gcc.target/aarch64/sve/acle/general-c/struct_1.c: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@278942 138bc75d-0d04-0410-961f-82ee72b054a4
2019-12-03Mark constant-sized objects as addressable if they have poly-int accessesRichard Sandiford
If SVE code is written for a specific vector length, it might load from or store to fixed-sized objects. This needs to work even without -msve-vector-bits=N (which should never be needed for correctness). There's no way of handling a direct poly-int sized reference to a fixed-size register; it would have to go via memory. And in that case it's more efficient to mark the fixed-size object as addressable from the outset, like we do for array references with non-constant indices. 2019-12-03 Richard Sandiford <richard.sandiford@arm.com> gcc/ * cfgexpand.c (discover_nonconstant_array_refs_r): If an access with POLY_INT_CST size is made to a fixed-size object, force the object to live in memory. gcc/testsuite/ * gcc.target/aarch64/sve/acle/general/deref_1.c: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@278941 138bc75d-0d04-0410-961f-82ee72b054a4
2019-12-03Add missing amdgcn vcondu patternsAndrew Stubbs
2019-12-03 Andrew Stubbs <ams@codesourcery.com> gcc/ * config/gcn/gcn-valu.md: Change "vcondu" patterns to use VEC_1REG_MODE for the data mode. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@278940 138bc75d-0d04-0410-961f-82ee72b054a4
2019-12-03 PR c++/91363 - P0960R3: Parenthesized initialization of aggregates.Marek Polacek
This patch implements C++20 P0960R3: Parenthesized initialization of aggregates (<wg21.link/p0960>; see R0 for more background info). Essentially, if you have an aggregate, you can now initialize it by (x, y), similarly to {x, y}. E.g. struct A { int x, y; // no A(int, int) ctor (see paren-init14.C for = delete; case) }; A a(1, 2); The difference between ()-init and {}-init is that narrowing conversions are permitted, designators are not permitted, a temporary object bound to a reference does not have its lifetime extended, and there is no brace elision. Further, things like int a[](1, 2, 3); // will deduce the array size const A& r(1, 2.3, 3); // narrowing is OK int (&&rr)[](1, 2, 3); int b[3](1, 2); // b[2] will be value-initialized now work as expected. Note that char f[]("fluff"); has always worked and this patch keeps it that way. Also note that A a((1, 2)) is not the same as A a{{1,2}}; the inner (1, 2) remains a COMPOUND_EXPR. The approach I took was to handle (1, 2) similarly to {1, 2} -- conjure up a CONSTRUCTOR, and introduce LOOKUP_AGGREGATE_PAREN_INIT to distinguish between the two. This kind of initialization is only supported in C++20; I've made no attempt to support it in earlier standards, like we don't support CTAD pre-C++17, for instance. * c-cppbuiltin.c (c_cpp_builtins): Predefine __cpp_aggregate_paren_init=201902 for -std=c++2a. * call.c (build_new_method_call_1): Handle parenthesized initialization of aggregates by building up a CONSTRUCTOR. (extend_ref_init_temps): Do nothing for CONSTRUCTOR_IS_PAREN_INIT. * cp-tree.h (CONSTRUCTOR_IS_PAREN_INIT, LOOKUP_AGGREGATE_PAREN_INIT): Define. * decl.c (grok_reference_init): Handle aggregate initialization from a parenthesized list of values. (reshape_init): Do nothing for CONSTRUCTOR_IS_PAREN_INIT. (check_initializer): Handle initialization of an array from a parenthesized list of values. Use NULL_TREE instead of NULL. * tree.c (build_cplus_new): Handle BRACE_ENCLOSED_INITIALIZER_P. * typeck2.c (digest_init_r): Set LOOKUP_AGGREGATE_PAREN_INIT if it receives a CONSTRUCTOR with CONSTRUCTOR_IS_PAREN_INIT set. Allow narrowing when LOOKUP_AGGREGATE_PAREN_INIT. (massage_init_elt): Don't lose LOOKUP_AGGREGATE_PAREN_INIT when passing flags to digest_init_r. * g++.dg/cpp0x/constexpr-99.C: Only expect an error in C++17 and lesser. * g++.dg/cpp0x/explicit7.C: Likewise. * g++.dg/cpp0x/initlist12.C: Adjust dg-error. * g++.dg/cpp0x/pr31437.C: Likewise. * g++.dg/cpp2a/feat-cxx2a.C: Add __cpp_aggregate_paren_init test. * g++.dg/cpp2a/paren-init1.C: New test. * g++.dg/cpp2a/paren-init10.C: New test. * g++.dg/cpp2a/paren-init11.C: New test. * g++.dg/cpp2a/paren-init12.C: New test. * g++.dg/cpp2a/paren-init13.C: New test. * g++.dg/cpp2a/paren-init14.C: New test. * g++.dg/cpp2a/paren-init15.C: New test. * g++.dg/cpp2a/paren-init16.C: New test. * g++.dg/cpp2a/paren-init17.C: New test. * g++.dg/cpp2a/paren-init18.C: New test. * g++.dg/cpp2a/paren-init19.C: New test. * g++.dg/cpp2a/paren-init2.C: New test. * g++.dg/cpp2a/paren-init3.C: New test. * g++.dg/cpp2a/paren-init4.C: New test. * g++.dg/cpp2a/paren-init5.C: New test. * g++.dg/cpp2a/paren-init6.C: New test. * g++.dg/cpp2a/paren-init7.C: New test. * g++.dg/cpp2a/paren-init8.C: New test. * g++.dg/cpp2a/paren-init9.C: New test. * g++.dg/ext/desig10.C: Adjust dg-error. * g++.dg/template/crash107.C: Likewise. * g++.dg/template/crash95.C: Likewise. * g++.old-deja/g++.jason/crash3.C: Likewise. * g++.old-deja/g++.law/ctors11.C: Likewise. * g++.old-deja/g++.law/ctors9.C: Likewise. * g++.old-deja/g++.mike/net22.C: Likewise. * g++.old-deja/g++.niklas/t128.C: Likewise. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@278939 138bc75d-0d04-0410-961f-82ee72b054a4
2019-12-032019-12-03 Richard Biener <rguenther@suse.de>Richard Biener
PR tree-optimization/92758 * tree-ssa-forwprop.c (simplify_vector_constructor): Restore operation on uniform vectors. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@278938 138bc75d-0d04-0410-961f-82ee72b054a4
2019-12-03Validate acc_device_t usesFrederik Harwath
Check that function arguments of type acc_device_t are valid enumeration values in all publicly visible functions from oacc-init.c. 2019-12-03 Frederik Harwath <frederik@codesourcery.com> libgomp/ * oacc-init.c (acc_known_device_type): Add function. (unknown_device_type_error): Add function. (name_of_acc_device_t): Change to call unknown_device_type_error on unknown type. (resolve_device): Use acc_known_device_type. (acc_init): Fail if acc_device_t argument is not valid. (acc_shutdown): Likewise. (acc_get_num_devices): Likewise. (acc_set_device_type): Likewise. (acc_get_device_num): Likewise. (acc_set_device_num): Likewise. (acc_on_device): Add comment that argument validity is not checked. Reviewed-by: Thomas Schwinge <thomas@codesourcery.com> git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@278937 138bc75d-0d04-0410-961f-82ee72b054a4
2019-12-03Enable OpenACC GCN testing.Andrew Stubbs
2019-12-03 Andrew Stubbs <ams@codesourcery.com> libgomp/ * testsuite/lib/libgomp.exp (offload_target_to_openacc_device_type): Recognize amdgcn. (check_effective_target_openacc_amdgcn_accel_present): New proc. (check_effective_target_openacc_amdgcn_accel_selected): New proc. * testsuite/libgomp.oacc-c++/c++.exp: Add support for amdgcn. * testsuite/libgomp.oacc-c/c.exp: Likewise. * testsuite/libgomp.oacc-fortran/fortran.exp: Likewise. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@278935 138bc75d-0d04-0410-961f-82ee72b054a4
2019-12-032019-12-03 Richard Biener <rguenther@suse.de>Richard Biener
PR tree-optimization/92645 * gimple-fold.c (gimple_fold_builtin_memory_op): Fold memcpy from or to a properly aligned register variable. * gcc.target/i386/pr92645-5.c: New testcase. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@278934 138bc75d-0d04-0410-961f-82ee72b054a4