aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-12-05i386: Combine splitters followup [PR96226]Jakub Jelinek1-4/+2
Here is the patch to simplify the newly added combine splitters, when we split into 2 insns anyway, no reason to split into the masking define_insn_and_split we'd be splitting shortly after. 2020-12-05 Jakub Jelinek <jakub@redhat.com> PR target/96226 * config/i386/i386.md (splitter after *<rotate_insn><mode>3_mask, splitter after *<rotate_insn><mode>3_mask_1): Drop the masking from the patterns to split into.
2020-12-05c++: Fix constexpr access to union member through pointer-to-member [PR98122]Jakub Jelinek3-13/+90
We currently incorrectly reject the first testcase, because cxx_fold_indirect_ref_1 doesn't attempt to handle UNION_TYPEs. As the second testcase shows, it isn't that easy, because I believe we need to take into account the active member and prefer that active member over other members, because if we pick a non-active one, we might reject valid programs. 2020-12-05 Jakub Jelinek <jakub@redhat.com> PR c++/98122 * constexpr.c (cxx_union_active_member): New function. (cxx_fold_indirect_ref_1): Add ctx argument, pass it through to recursive call. Handle UNION_TYPE. (cxx_fold_indirect_ref): Add ctx argument, pass it to recursive calls and cxx_fold_indirect_ref_1. (cxx_eval_indirect_ref): Adjust cxx_fold_indirect_ref calls. * g++.dg/cpp1y/constexpr-98122.C: New test. * g++.dg/cpp2a/constexpr-98122.C: New test.
2020-12-05Daily bump.GCC Administrator6-1/+194
2020-12-04runtime: update type descriptor name in fieldtrack C support codeIan Lance Taylor2-2/+2
We were using the old name, but nothing noticed because it is a weak reference that is permitted to be nil, so that it works with code that does not use the field tracking library. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/275449
2020-12-04c++: Fix deduction from auto template parameter [PR93083]Jason Merrill2-5/+86
The check in do_class_deduction to handle passing one class placeholder template parm as an argument for itself needed to be extended to also handle equivalent parms from other templates. gcc/cp/ChangeLog: PR c++/93083 * pt.c (convert_template_argument): Handle equivalent placeholders. (do_class_deduction): Look through EXPR_PACK_EXPANSION, too. gcc/testsuite/ChangeLog: PR c++/93083 * g++.dg/cpp2a/nontype-class40.C: New test.
2020-12-04vec: Simplify use with C++11 range-based 'for'.Jason Merrill5-8/+14
It looks cleaner if we can use a vec* directly as a range for the C++11 range-based 'for' loop, without needing to indirect from it, and also works with null pointers. The change in cp_parser_late_parsing_default_args is an example of how this can be used to simplify a simple loop over a vector. Reverse or subset iteration will require adding range adaptors. I deliberately didn't format the new overloads for etags since they are trivial. gcc/ChangeLog: * vec.h (begin, end): Add overloads for vec*. * tree.c (build_constructor_from_vec): Remove *. gcc/cp/ChangeLog: * decl2.c (clear_consteval_vfns): Remove *. * pt.c (do_auto_deduction): Remove *. * parser.c (cp_parser_late_parsing_default_args): Change loop to use range 'for'.
2020-12-04rs6000: fix PTR_SIZE in rs6000.cDavid Edelsohn1-1/+1
The recent change to rs6000.c for DWARF in AIX references the macro PTR_SIZE that only is defined in dwarf2out.c. This patch changes the reference to the equivalent POINTER_SIZE_UNITS defined in defaults.h. gcc/ChangeLog: * config/rs6000/rs6000.c (rs6000_option_override_internal): Change PTR_SIZE to POINTER_SIZE_UNITS.
2020-12-04doc/implement-c.texi: About same-as-scalar-type volatile aggregate accesses, ↵Hans-Peter Nilsson1-0/+5
PR94600 We say very little about reads and writes to aggregate / compound objects, just scalar objects (i.e. assignments don't cause reads). Let's lets say something safe about aggregate objects, but only for those that are the same size as a scalar type. There's an equal-sounding section (Volatiles) in extend.texi, but this seems a more appropriate place, as specifying the behavior of a standard qualifier. gcc: 2020-12-04 Hans-Peter Nilsson <hp@axis.com> Martin Sebor <msebor@redhat.com> PR middle-end/94600 * doc/implement-c.texi (Qualifiers implementation): Add blurb about access to the whole of a volatile aggregate object, only for same-size as a scalar object.
2020-12-04gimple: Return fnspec only for replaceable new/delete operators called from ↵Jakub Jelinek2-1/+27
new/delete [PR98130] As mentioned in the PR, we shouldn't treat non-replaceable operator new/delete (e.g. with the placement new) as replaceable ones. There is some pending discussion that perhaps operator delete called from delete if not replaceable should return some other fnspec, but can we handle that incrementally, fix this wrong-code and then deal with a missed optimization? I really don't know what exactly should be returned. 2020-12-04 Jakub Jelinek <jakub@redhat.com> PR c++/98130 * gimple.c (gimple_call_fnspec): Only return ".co " for replaceable operator delete or ".mC" for replaceable operator new called from new/delete. * g++.dg/opt/pr98130.C: New test.
2020-12-04i386: Add combine splitters to allow combining multiple insns into reg1 = ↵Jakub Jelinek2-0/+48
const; reg2 = rotate (reg1, reg3 & cst) [PR96226] As mentioned in the PR, we can combine ~(1 << x) into -2 r<< x, but we give up in the ~(1 << (x & 31)) cases, as *<rotate_insn><mode>3_mask* don't allow immediate operand 1 and find_split_point prefers to split (x & 31) instead of the constant. With these combine splitters we help combine decide how to split those insns. 2020-12-04 Jakub Jelinek <jakub@redhat.com> PR target/96226 * config/i386/i386.md (splitter after *<rotate_insn><mode>3_mask, splitter after *<rotate_insn><mode>3_mask_1): New combine splitters. * gcc.target/i386/pr96226.c: New test.
2020-12-04fold-const: Don't use build_constructor for non-aggregate types in ↵Jakub Jelinek2-4/+37
native_encode_initializer [PR93121] The following testcase is rejected, because when trying to encode a zeroing CONSTRUCTOR, the code was using build_constructor to build initializers for the elements but when recursing the function handles CONSTRUCTOR only for aggregate types. The following patch fixes that by using build_zero_cst instead for non-aggregates. Another option would be add handling CONSTRUCTOR for non-aggregates in native_encode_initializer. Or we can do both, I guess the middle-end generally doesn't like CONSTRUCTORs for scalar variables, but am not 100% sure if the FE doesn't produce those sometimes. 2020-12-04 Jakub Jelinek <jakub@redhat.com> PR libstdc++/93121 * fold-const.c (native_encode_initializer): Use build_zero_cst instead of build_constructor. * g++.dg/cpp2a/bit-cast6.C: New test.
2020-12-04c++: Revert dependent-array changes [PR 98116]Nathan Sidwell5-49/+30
The changes reverted here are exposing an existing problem with alias template comparisons. The typename_type changes are also incomplete, possibly for similar reasons. It seems safer to revert them, fix the underlying issue and then move forwards. The testcases is adjusted to more robustly check the specialization table, and ICEs with and without the c++ changes. Revert: 62fb1b9e0da c++: Fix array type dependency [PR 98107] 07589ca2b2c c++: typename_type structural comparison 29ae1d7751 c++: Extend build_array_type API PR c++/98116 gcc/cp/ * cp-tree.h (comparing_typenames): Delete. (cplus_build_array_type): Remove default parm. * pt.c (comparing_typenames): Delete. (spec_hasher::equal): Don't increment it. * tree.c (set_array_type_canon): Remove dep parm. (build_cplus_array_type): Remove dep parm changes. (cp_build_qualified_type_real): Remove dependent array type changes. (strip_typedefs): Likewise. * typeck.c (structural_comptypes): Revert comparing_typename changes. gcc/testsuite/ * g++.dg/template/pr98116.C: Enable robust checking.
2020-12-04c++: Module API declarationsNathan Sidwell1-0/+97
This provides the inline predicates about module state, and declares the functions to be provided. gcc/cp/ * cp-tree.h: Add various inline module state predicates, and declare the API that will be provided by modules.cc
2020-12-04debug: Fix another vector DECL_MODE ICE [PR98100]Jakub Jelinek2-2/+14
The PR88587 fix changes DECL_MODE of vars with vector type during inlining/cloning when the vars are copied, so that their DECL_MODE matches their TYPE_MODE in the new function. Unfortunately, the following testcase still ICEs, the var isn't really used in the new function and so it isn't copied, but becomes just a nonlocalized var. So we can't adjust its DECL_MODE because it appears in multiple functions and needs different modes in between them. The following patch changes the DEBUG_INSN creation to use TYPE_MODE instead of DECL_MODE for vars with vector types. 2020-12-04 Jakub Jelinek <jakub@redhat.com> PR target/98100 * cfgexpand.c (expand_gimple_basic_block): For vars with vector type, use TYPE_MODE rather than DECL_MODE. * gcc.target/i386/pr98100.c: New test.
2020-12-04dwarf: Add -gdwarf{32,64} optionsJakub Jelinek4-95/+121
The following patch makes the choice between 32-bit and 64-bit DWARF formats selectable by command line switch, rather than being hardcoded through DWARF_OFFSET_SIZE macro. The options themselves don't turn on debug info themselves, so one needs to use -g -gdwarf64 or similar. 2020-12-04 Jakub Jelinek <jakub@redhat.com> * common.opt (-gdwarf32, -gdwarf64): New options. * config/rs6000/rs6000.c (rs6000_option_override_internal): Default dwarf_offset_size to 8 if not overridden from the command line. * dwarf2out.c: Change all occurrences of DWARF_OFFSET_SIZE to dwarf_offset_size. * doc/invoke.texi (-gdwarf32, -gdwarf64): Document.
2020-12-04testsuite: use param for if-to-switch testsMartin Liska3-3/+3
gcc/testsuite/ChangeLog: PR testsuite/98123 * gcc.dg/tree-ssa/if-to-switch-4.c: Add param to make the test stable on all architectures. * gcc.dg/tree-ssa/if-to-switch-6.c: Likewise. * gcc.dg/tree-ssa/if-to-switch-8.c: Likewise.
2020-12-04Add target selector to gcc.dg/pr98099.cEric Botcazou1-1/+1
gcc/testsuite/ChangeLog: * gcc.dg/pr98099.c: Compile only for dfp targets.
2020-12-04Refactor -frecord-gcc-switches.Martin Liska8-391/+166
gcc/ChangeLog: * doc/tm.texi: Change argument of the record_gcc_switches hook and remove SWITCH_TYPE_* enum values. * dwarf2out.c (gen_producer_string): Move to opts.c and remove handling of the dwarf_record_gcc_switches option. (dwarf2out_early_finish): Use moved gen_producer_string function. * opts.c (gen_producer_string): New. * opts.h (gen_producer_string): New. * target.def: Change type of record_gcc_switches. * target.h (enum print_switch_type): Remove. (elf_record_gcc_switches): Change first argument. * toplev.c (MAX_LINE): Remove. (print_to_asm_out_file): Likewise. (print_to_stderr): Likewise. (print_single_switch): Likewise. (print_switch_values): Likewise. (init_asm_output): Use new gen_producer_string function. (process_options): Likewise. * varasm.c (elf_record_gcc_switches): Just save the string argument to the ELF container.
2020-12-04Fix checking failure in IPA-SRAEric Botcazou5-1/+53
This is a regression present on the mainline and 10 branch: on the one hand, IPA-SRA does *not* disqualify accesses with zero size but, on the other hand, it checks that accesses present in the tree have a (strictly) positive size, thus trivially yielding an ICE in some cases. gcc/ChangeLog: * ipa-sra.c (verify_access_tree_1): Relax assertion on the size. gcc/testsuite/ChangeLog: * gnat.dg/opt91.ads, gnat.dg/opt91.adb: New test. * gnat.dg/opt91_pkg.ads, gnat.dg/opt91_pkg.adb: New helper.
2020-12-04Document missing params.Martin Liska2-8/+44
contrib/ChangeLog: * check-params-in-docs.py: use flake8 and add some tweaks to ignore aarch64 params. gcc/ChangeLog: * doc/invoke.texi: Add missing params.
2020-12-04c++: Change __builtin_source_location to use __PRETTY_FUNCTION__ instead of ↵Jakub Jelinek7-31/+27
__FUNCTION__ [PR80780] On Tue, Dec 01, 2020 at 01:03:52PM +0000, Jonathan Wakely via Gcc-patches wrote: > I mentioned in PR 80780 that a __builtin__PRETTY_FUNCTION would have > been nice, because __FUNCTION__ isn't very useful for C++, because of > overloading and namespace/class scopes. There are an unlimited number > of functions that have __FUNCTION__ == "s", e.g. "ns::s(int)" and > "ns::s()" and "another_scope::s::s<T...>(T...)" etc. > > Since __builtin_source_location() can do whatever it wants (without > needing to add __builtin__PRETTY_FUNCTION) it might be nice to use the > __PRETTY_FUNCTION__ string. JeanHeyd's tests would still need changes, > because the name would be "s::s(void*)" not "s::s" but that still > seems better for users. When I've added template tests for the previous patch, I have noticed that the current __builtin_source_location behavior is not really __FUNCTION__, just close, because e.g. in function template __FUNCTION__ is still "bar" but __builtin_source_location gave "bar<0>". Anyway, this patch implements above request to follow __PRETTY_FUNCTION__ (on top of the earlier posted patch). 2020-12-04 Jakub Jelinek <jakub@redhat.com> PR c++/80780 * cp-gimplify.c (fold_builtin_source_location): Use 2 instead of 0 as last argument to cxx_printable_name. * g++.dg/cpp2a/srcloc1.C (quux): Use __PRETTY_FUNCTION__ instead of function. * g++.dg/cpp2a/srcloc2.C (quux): Likewise. * g++.dg/cpp2a/srcloc15.C (S::S): Likewise. (bar): Likewise. Adjust expected column. * g++.dg/cpp2a/srcloc17.C (S::S): Likewise. (bar): Likewise. Adjust expected column. * testsuite/18_support/source_location/1.cc (main): Adjust for __builtin_source_location using __PRETTY_FUNCTION__-like names instead __FUNCTION__-like. * testsuite/18_support/source_location/consteval.cc (main): Likewise.
2020-12-04Daily bump.GCC Administrator8-1/+492
2020-12-03c++: XFAIL testcase for PR98019Jason Merrill1-0/+1
Apparently it isn't actually fixed on trunk yet, was just passing because of some WIP in my tree. So XFAIL for now. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/concepts-nodiscard1.C: XFAIL.
2020-12-03c++: Fix bootstrap on 32-bit hosts [PR91828]Jason Merrill1-2/+4
Using the releasing_vec op[] with an int index was breaking on 32-bit hosts because of ambiguity with the built-in operator and the conversion function. Since the built-in operator has a ptrdiff_t, this was fine on 64-bit targets where ptrdiff_t is larger than int, but broke on 32-bit targets where it's the same as int, making the conversion for that argument better than the member function. Fixed by changing the member function to also use ptrdiff_t for the index. gcc/cp/ChangeLog: * cp-tree.h (releasing_vec::operator[]): Change parameter type to ptrdiff_t.
2020-12-03Add support for detecting mismatched allocation/deallocation calls.Martin Sebor27-69/+2530
PR c++/90629 - Support for -Wmismatched-new-delete PR middle-end/94527 - Add an __attribute__ that marks a function as freeing an object gcc/ChangeLog: PR c++/90629 PR middle-end/94527 * builtins.c (access_ref::access_ref): Initialize new member. (compute_objsize): Use access_ref::deref. Handle simple pointer assignment. (expand_builtin): Remove handling of the free built-in. (call_dealloc_argno): Same. (find_assignment_location): New function. (fndecl_alloc_p): Same. (gimple_call_alloc_p): Same. (call_dealloc_p): Same. (matching_alloc_calls_p): Same. (warn_dealloc_offset): Same. (maybe_emit_free_warning): Same. * builtins.h (struct access_ref): Declare new member. (maybe_emit_free_warning): Make extern. Make use of access_ref. Handle -Wmismatched-new-delete. * calls.c (initialize_argument_information): Call maybe_emit_free_warning. * doc/extend.texi (attribute malloc): Update. * doc/invoke.texi (-Wfree-nonheap-object): Expand documentation. (-Wmismatched-new-delete): Document new option. (-Wmismatched-dealloc): Document new option. gcc/c-family/ChangeLog: PR c++/90629 PR middle-end/94527 * c-attribs.c (handle_dealloc_attribute): New function. (handle_malloc_attribute): Handle argument forms of attribute. * c.opt (-Wmismatched-dealloc): New option. (-Wmismatched-new-delete): New option. gcc/testsuite/ChangeLog: PR c++/90629 PR middle-end/94527 * g++.dg/asan/asan_test.cc: Fix a bug. * g++.dg/warn/delete-array-1.C: Add expected warning. * g++.old-deja/g++.other/delete2.C: Add expected warning. * g++.dg/warn/Wfree-nonheap-object-2.C: New test. * g++.dg/warn/Wfree-nonheap-object.C: New test. * g++.dg/warn/Wmismatched-new-delete.C: New test. * g++.dg/warn/Wmismatched-dealloc-2.C: New test. * g++.dg/warn/Wmismatched-dealloc.C: New test. * gcc.dg/Wmismatched-dealloc.c: New test. * gcc.dg/analyzer/malloc-1.c: Prune out expected warning. * gcc.dg/attr-malloc.c: New test. * gcc.dg/free-1.c: Adjust text of expected warning. * gcc.dg/free-2.c: Same. * gcc.dg/torture/pr71816.c: Prune out expected warning. * gcc.dg/tree-ssa/pr19831-2.c: Add an expected warning. * gcc.dg/Wfree-nonheap-object-2.c: New test. * gcc.dg/Wfree-nonheap-object-3.c: New test. * gcc.dg/Wfree-nonheap-object.c: New test. libstdc++-v3/ChangeLog: * testsuite/ext/vstring/modifiers/clear/56166.cc: Suppress a false positive warning.
2020-12-03c++: Exported using declsNathan Sidwell2-7/+25
With modules we need to record whethe a (namespace-scope) using decl is exporting the named entities. Record this on the OVERLOAD marking the used decl. gcc/cp/ * cp-tree.h (OVL_EXPORT): New. (class ovl_iterator): Add get_using, exporting_p. * tree.c (ovl_insert): Extend using_or_hidden meaning to include an exported using.
2020-12-03c++: uninstantiated template friendsNathan Sidwell2-1/+20
template friends need to be recognized by module streaming and associated with the befriending class. but their context is that of the friend (a namespace or other class). This adds a flag to mark such templates, and uses their DECL_CHAIN to point at the befriender. gcc/cp * cp-tree.h (DECL_UNINSTANTIATED_TEMPLATE_FRIEND): New. * pt.c (push_template_decl): Set it. (tsubst_friend_function): Clear it.
2020-12-03Go testsuite: update new tests to version in source repoIan Lance Taylor23-59/+50
2020-12-03PowerPC: PR libgcc/97543 and libgcc/97643, fix long double issuesMichael Meissner1-0/+22
If you use a compiler with long double defaulting to 64-bit instead of 128-bit with IBM extended double, you get linker warnings about mis-matches in the gnu attributes for long double (PR libgcc/97543). Even if the compiler is configured to have long double be 64 bit as the default with the configuration option '--without-long-double-128' you get the warnings. You also get the same issues if you use a compiler with long double defaulting to IEEE 128-bit instead of IBM extended double (PR libgcc/97643). The issue is the way libgcc.a/libgcc.so is built. Right now when building libgcc under Linux, the long double size is set to 128-bits when building libgcc. However, the gnu attributes are set, leading to the warnings. One feature of the current GNU attribute implementation is if you have a shared library (such as libgcc_s.so), the GNU attributes for the shared library is an inclusive OR of all of the objects within the library. This means if any object file that uses the -mlong-double-128 option and uses long double, the GNU attributes for the library will indicate that it uses 128-bit IBM long doubles. If you have a static library, you will get the warning only if you actually reference an object file with the attribute set. This patch does two things: 1) All of the object files that support IBM 128-bit long doubles explicitly set the ABI to IBM extended double. 2) I turned off GNU attributes for building the shared library or for building the IBM 128-bit long double support. libgcc/ 2020-12-03 Michael Meissner <meissner@linux.ibm.com> PR libgcc/97543 PR libgcc/97643 * config/rs6000/t-linux (IBM128_STATIC_OBJS): New make variable. (IBM128_SHARED_OBJS): New make variable. (IBM128_OBJS): New make variable. Set all objects to use the explicit IBM format, and disable gnu attributes. (IBM128_CFLAGS): New make variable. (gcc_s_compile): Add -mno-gnu-attribute to all shared library modules.
2020-12-03PR fortran/95342 - ICE in gfc_match_subroutine, at fortran/decl.c:7913Harald Anlauf2-0/+22
Add checks for NULL pointers before dereferencing them. gcc/fortran/ChangeLog: PR fortran/95342 * decl.c (gfc_match_function_decl): Avoid NULL pointer dereference. (gfc_match_subroutine): Likewise. gcc/testsuite/ChangeLog: PR fortran/95342 * gfortran.dg/pr95342.f90: New test.
2020-12-03libstdc++: Fix typos in #error stringsJonathan Wakely2-4/+4
libstdc++-v3/ChangeLog: * testsuite/26_numerics/bit/bit.cast/bit_cast.cc: Remove stray word from copy&paste. * testsuite/26_numerics/bit/bit.cast/version.cc: Likewise.
2020-12-03fix __builtin___clear_cache overrider falloutAlexandre Oliva2-1/+8
Machines that had CLEAR_CACHE_INSN and that would thus issue calls to __clear_cache with the default call expander, would fail on languages that did not set up the __clear_cache builtin. This patch arranges for all languages to set up this builtin. Machines or multilibs that had ptr_mode != Pmode, such as aarch64 with -mabi=ilp32, would fail the RTL mode test of the arguments passed to __clear_cache, because we'd insist on ptr_mode. This patch arranges for Pmode to be accepted as well. for gcc/ChangeLog * tree.c (build_common_builtin_nodes): Declare __builtin___clear_cache for all languages. * builtins.c (maybe_emit_call_builtin___clear_cache): Accept Pmode arguments.
2020-12-03libstdc++: Update C++20 library implementation statusJonathan Wakely3-21/+15
libstdc++-v3/ChangeLog: * doc/xml/manual/status_cxx2020.xml: Update C++20 status. * doc/html/*: Regenerate.
2020-12-03libtdc++: Define std::source_location for C++20JeanHeyd Meneide9-0/+454
This doesn't define a new _GLIBCXX_HAVE_BUILTIN_SOURCE_LOCATION macro. because using __has_builtin(__builtin_source_location) is sufficient. Currently only GCC supports it, but if/when Clang and Intel add it the __has_builtin check should for them too. Co-authored-by: Jonathan Wakely <jwakely@redhat.com> libstdc++-v3/ChangeLog: * doc/doxygen/user.cfg.in (INPUT): Add <source_location>. * include/Makefile.am: Add <source_location>. * include/Makefile.in: Regenerate. * include/std/version (__cpp_lib_source_location): Define. * include/std/source_location: New file. * testsuite/18_support/source_location/1.cc: New test. * testsuite/18_support/source_location/consteval.cc: New test. * testsuite/18_support/source_location/srcloc.h: New test. * testsuite/18_support/source_location/version.cc: New test.
2020-12-03libstdc++: Add std::bit_cast for C++20 [PR 93121]Jonathan Wakely4-0/+123
Thanks to Jakub's addition of the built-in, we can add this to the library now. The compiler tests for the built-in are quite extensive, including verifying the constraints, so this only adds minimal tests to the library testsuite. This doesn't add a new _GLIBCXX_HAVE_BUILTIN_BIT_CAST because using __has_builtin(__builtin_bit_cast) works for GCC and versions of Clang that provide the built-in. libstdc++-v3/ChangeLog: PR libstdc++/93121 * include/std/bit (__cpp_lib_bit_cast, bit_cast): Define. * include/std/version (__cpp_lib_bit_cast): Define. * testsuite/26_numerics/bit/bit.cast/bit_cast.cc: New test. * testsuite/26_numerics/bit/bit.cast/version.cc: New test.
2020-12-03Go testsuite: add a bunch of new tests from source repoIan Lance Taylor112-0/+3339
2020-12-03go-test.exp: add -I. when compiling in directoryIan Lance Taylor1-5/+5
* go.test/go-test.exp (go-gc-tests): Add -I. when building all sources in a directory (errorcheckdir, compiledir, rundir, rundircmpout).
2020-12-03c++: Add testcase for PR98019Jason Merrill1-0/+10
This has already been fixed on trunk, but I don't see a testcase for it. gcc/testsuite/ChangeLog: PR c++/98019 * g++.dg/cpp2a/concepts-nodiscard1.C: New test.
2020-12-03testsuite: update existing Go tests to source repoIan Lance Taylor582-10318/+4741
This updates a bunch of existing Go tests to the contents of the source repo. This does not add any of the newer tests.
2020-12-03RTEMS: Add Cortex-R52 multilibSebastian Huber1-2/+3
gcc/ * config/arm/t-rtems: Add "-mthumb -mcpu=cortex-r52 -mfloat-abi=hard" multilib.
2020-12-03libstdc++: Update powerpc-linux baselines for GCC 10.1Jonathan Wakely2-0/+34
This should have been done before the GCC 10.1 release. libstdc++-v3/ChangeLog: * config/abi/post/powerpc-linux-gnu/baseline_symbols.txt: Update. * config/abi/post/powerpc64-linux-gnu/32/baseline_symbols.txt: Update.
2020-12-03libstdc++: Disable std::array assertions for C++11 constexprJonathan Wakely4-11/+48
The recent changes to add assertions to std::array broke the functions that need to be constexpr in C++11, because of the restrictive rules for constexpr functions in C++11. This simply disables the assertions for C++11 mode, so the functions can be constexpr again. libstdc++-v3/ChangeLog: * include/std/array (array::operator[](size_t) const, array::front() const) (array::back() const) [__cplusplus == 201103]: Disable assertions. * testsuite/23_containers/array/element_access/constexpr_element_access.cc: Check for correct values. * testsuite/23_containers/array/tuple_interface/get_neg.cc: Adjust dg-error line numbers. * testsuite/23_containers/array/debug/constexpr_c++11.cc: New test.
2020-12-03c++: templatey type creationNathan Sidwell3-11/+26
This patch makes a couple of type-creation routines available to modules. That needs to create unbound template parms, and canonical template parms. gcc/cp/ * cp-tree.h (make_unbound_class_template_raw): Declare. (canonical_type_parameter): Declare. * decl.c (make_unbound_class_template_raw): Break out of ... (make_unboud_class_template): ... here. Call it. * pt.c (canonical_type_parameter): Externalize. Refactor & set structural_equality for type parms.
2020-12-03i386: Fix up ix86_md_asm_adjust for TImode [PR98086]Uros Bizjak2-30/+25
ix86_md_asm_adjust assumes that dest_mode can be only [QHSD]Imode and nothing else. The patch rewrites zero-extension part to use convert_to_mode to handle TImode and hypothetically even wider modes. 2020-12-03 Uroš Bizjak <ubizjak@gmail.com> Jakub Jelinek <jakub@redhat.com> gcc/ PR target/98086 * config/i386/i386.c (ix86_md_asm_adjustmd): Rewrite zero-extension part to use convert_to_mode. gcc/testsuite/ PR target/98086 * gcc.target/i386/pr98086.c: New test.
2020-12-03c++: Testcases [PR 98115]Nathan Sidwell2-0/+33
These two testcases provide coverage for 98115, which doesn't trigger on all hosts. PR c++/98115 PR c++/98116 gcc/testsuite/ * g++.dg/template/pr98115.C: New. * g++.dg/template/pr98116.C: New.
2020-12-03compiler: cast comparison function result to expected bool typeIan Lance Taylor3-6/+49
Otherwise cases like type mybool bool var b mybool = [10]string{} == [10]string{} get an incorrect type checking error. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/274446
2020-12-03compiler: defer to middle-end for complex divisionIan Lance Taylor9-2543/+4176
Go used to use slightly different semantics than C99 for complex division, so we used runtime routines to handle the different. The gc compiler has changes its behavior to match C99, so changes ours as well. For golang/go#14644 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/274213
2020-12-03IBM Z: Fix mode in probe_stack patternAndreas Krebbel2-3/+13
The probe pattern uses Pmode but the middle-end wants to emit a word_mode probe check. This - as usual - breaks on Z with -m31 -mzarch were word_mode doesn't match Pmode. gcc/ChangeLog: * config/s390/s390.md ("@probe_stack2<mode>"): Change mode iterator to W. gcc/testsuite/ChangeLog: * gcc.target/s390/stack-clash-4.c: New test.
2020-12-03c++: Fix array type dependency [PR 98107]Nathan Sidwell1-0/+10
I'd missed some paths through build_cplus_array_type, plus, some arrays come via the C-type builder. This propagates dependency in more places and asserts that in the cases where TYPE_DEPENDENT_P_VALID is unset, the type is non-dependent. PR c++/98107 gcc/cp/ * tree.c (build_cplus_array_type): Mark dependency of new variant. (cp_build_qualified_type_real, strip_typedefs): Assert TYPE_DEPENDENT_P_VALID, or not a dependent type.
2020-12-03aarch64: Don't fold svundef* at the gimple levelRichard Sandiford2-11/+12
As the testcase shows, folding svundef*() at the gimple level has the unfortunate side-effect of introducing -Wuninitialized or -Wmaybe-uninitialized warnings. We don't have a testcase that relies on the fold, so the easiest fix seems to be to remove it. gcc/ * config/aarch64/aarch64-sve-builtins-base.cc (svundef_impl::fold): Delete. gcc/testsuite/ * gcc.target/aarch64/sve/acle/general/undef_1.c: New test.