aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2018-11-07gcc: xtensa: don't force PIC for uclinux targetreleases/gcc-6Max Filippov2-2/+9
xtensa-uclinux uses bFLT executable file format that cannot relocate fields representing offsets from data to code. C++ objects built as PIC use offsets to encode FDE structures. As a result C++ exception handling doesn't work correctly on xtensa-uclinux. Don't use PIC by default on xtensa-uclinux. gcc/ 2018-11-07 Max Filippov <jcmvbkbc@gmail.com> Backport from mainline 2018-11-05 Max Filippov <jcmvbkbc@gmail.com> * config/xtensa/uclinux.h (XTENSA_ALWAYS_PIC): Change to 0. From-SVN: r265890
2018-10-26Update ChangeLog and version files for releasereleases/gcc-6.5.0GCC Administrator56-1/+221
From-SVN: r265524
2018-10-26Daily bump.GCC Administrator1-1/+1
From-SVN: r265511
2018-10-25PR libstdc++/87749 fix (and optimize) string move constructionJonathan Wakely6-6/+258
The move constructor for the SSO string uses assign(const basic_string&) when either: (1) the source string is "local" and so the contents of the small string buffer need to be copied, or (2) the allocator does not propagate and is_always_equal is false. Case (1) is suboptimal, because the assign member is not noexcept and the compiler isn't smart enough to see it won't actually throw in this case. This causes extra code in the move assignment operator so that any exception will be turned into a call to std::terminate. This can be fixed by copying small strings inline instead of calling assign. Case (2) is a bug, because the specific instances of the allocators could be equal even if is_always_equal is false. This can result in an unnecessary deep copy (and potentially-throwing allocation) when the storage should be moved. This can be fixed by simply checking if the allocators are equal. PR libstdc++/87749 * include/bits/basic_string.h [_GLIBCXX_USE_CXX11_ABI] (basic_string::operator=(basic_string&&)): For short strings copy the buffer inline. Only fall back to using assign(const basic_string&) to do a deep copy when reallocation is needed. * testsuite/21_strings/basic_string/modifiers/assign/char/87749.cc: New test. * testsuite/21_strings/basic_string/modifiers/assign/char/ move_assign_optim.cc: New test. * testsuite/21_strings/basic_string/modifiers/assign/wchar_t/87749.cc: New test. * testsuite/21_strings/basic_string/modifiers/assign/wchar_t/ move_assign_optim.cc: New test. From-SVN: r265500
2018-10-25PR libstdc++/87704 fix unique_ptr(nullptr_t) constructorsJonathan Wakely5-5/+55
Using a delegating constructor to implement these constructors means that they instantiate the destructor, which requires the element_type to be complete. In C++11 and C++14 they were specified to be delegating, but that was changed as part of LWG 2801 so in C++17 they don't require a complete type (as was intended all along). Backport from mainline 2018-10-23 Jonathan Wakely <jwakely@redhat.com> PR libstdc++/87704 * include/bits/unique_ptr.h (unique_ptr::unique_ptr(nullptr_t)): Do not delegate to default constructor. (unique_ptr<T[], D>::unique_ptr(nullptr_t)): Likewise. * testsuite/20_util/unique_ptr/cons/incomplete.cc: New test. From-SVN: r265499
2018-10-25Daily bump.GCC Administrator1-1/+1
From-SVN: r265475
2018-10-24Daily bump.GCC Administrator1-1/+1
From-SVN: r265445
2018-10-23backport "[c++] Fix DECL_BY_REFERENCE of clone parms"Tom de Vries4-0/+46
Consider test.C compiled at -O0 -g: ... class string { public: string (const char *p) { this->p = p ; } string (const string &s) { this->p = s.p; } private: const char *p; }; class foo { public: foo (string dir_hint) {} }; int main (void) { std::string s = "This is just a string"; foo bar(s); return 0; } ... When parsing foo::foo, the dir_hint parameter gets a DECL_ARG_TYPE of 'struct string & restrict'. Then during finish_struct, we call clone_constructors_and_destructors and create clones for foo::foo, and set the DECL_ARG_TYPE in the same way. Later on, during finish_function, cp_genericize is called for the original foo::foo, which sets the type of parm dir_hint to DECL_ARG_TYPE, and sets DECL_BY_REFERENCE of dir_hint to 1. After that, during maybe_clone_body update_cloned_parm is called with: ... (gdb) call debug_generic_expr (parm.typed.type) struct string & restrict (gdb) call debug_generic_expr (cloned_parm.typed.type) struct string ... The type of the cloned_parm is then set to the type of parm, but DECL_BY_REFERENCE is not set. When doing cp_genericize for the clone later on, TREE_ADDRESSABLE (TREE_TYPE ()) is no longer true for the updated type for the parm, so DECL_BY_REFERENCE is not set there either. The missing DECL_BY_REFERENCE on cloned_parm causes incorrect debug info to be generated. This patch fixes the problem by copying DECL_BY_REFERENCE in update_cloned_parm. Bootstrapped and reg-tested on x86_64. 2018-10-23 Tom de Vries <tdevries@suse.de> backport from trunk: 2018-07-31 Tom de Vries <tdevries@suse.de> PR debug/86687 * optimize.c (update_cloned_parm): Copy DECL_BY_REFERENCE. * g++.dg/guality/pr86687.C: New test. From-SVN: r265431
2018-10-23Daily bump.GCC Administrator1-1/+1
From-SVN: r265405
2018-10-22Daily bump.GCC Administrator1-1/+1
From-SVN: r265363
2018-10-21Daily bump.GCC Administrator1-1/+1
From-SVN: r265346
2018-10-20Daily bump.GCC Administrator1-1/+1
From-SVN: r265336
2018-10-19Daily bump.GCC Administrator1-1/+1
From-SVN: r265300
2018-10-18PR libstdc++/87641 correctly initialize accumulator in valarray::sum()Jonathan Wakely3-5/+89
Use the value of the first element as the initial value of the __valarray_sum accumulator. Value-initialization might not create the additive identity for the value type. PR libstdc++/87641 * include/bits/valarray_array.h (__valarray_sum): Use first element to initialize accumulator instead of value-initializing it. * testsuite/26_numerics/valarray/87641.cc: New test. From-SVN: r265291
2018-10-18Daily bump.GCC Administrator1-1/+1
From-SVN: r265252
2018-10-17re PR middle-end/87623 (bytes swapped in register when comparing cause fail ↵Eric Botcazou4-2/+47
when compiled with -O1 or higher) PR middle-end/87623 * fold-const.c (fold_truth_andor_1): If the right side is not constant, bail out if both sides do not have the same storage order. From-SVN: r265245
2018-10-17Daily bump.GCC Administrator1-1/+1
From-SVN: r265225
2018-10-16backport: close.c: Include <string.h>.Gerald Pfeifer2-0/+8
Backport from trunk * io/close.c [!HAVE_UNLINK_OPEN_FILE]: Include <string.h>. From-SVN: r265198
2018-10-16Daily bump.GCC Administrator1-1/+1
From-SVN: r265180
2018-10-15Adjust test to pass with latest glibcJonathan Wakely2-2/+9
Glibc changed the it_IT locales to use thousands separators, invalidating this test. Use nl_NL instead, as Dutch only uses grouping for money not numbers. * testsuite/22_locale/numpunct/members/char/3.cc: Adjust test to account for change to glibc it_IT localedata (glibc bz#10797). From-SVN: r265168
2018-10-15backport: re PR sanitizer/84761 (AddressSanitizer is not compatible with ↵Richard Biener2-14/+43
glibc 2.27 on x86) 2018-10-15 Richard Biener <rguenther@suse.de> Backport from mainline 2018-03-19 Jakub Jelinek <jakub@redhat.com> PR sanitizer/84761 * sanitizer_common/sanitizer_linux_libcdep.cc (__GLIBC_PREREQ): Define if not defined. (DL_INTERNAL_FUNCTION): Don't define. (InitTlsSize): For __i386__ if not compiled against glibc 2.27+ determine at runtime whether to use regparm(3), stdcall calling convention for older glibcs or normal calling convention for newer glibcs for call to _dl_get_tls_static_info. From-SVN: r265164
2018-10-15PR libstdc++/86751 default assignment operators for std::pairJonathan Wakely5-9/+170
The solution for PR 77537 causes ambiguities due to the extra copy assignment operator taking a __nonesuch_no_braces parameter. By making the base class non-assignable we don't need the extra deleted overload in std::pair. The copy assignment operator will be implicitly deleted (and the move assignment operator not declared) as needed. Without the additional user-provided operator in std::pair the ambiguity is avoided. Backport from mainline 2018-07-31 Jonathan Wakely <jwakely@redhat.com> PR libstdc++/86751 * include/bits/stl_pair.h (__pair_base): New class with deleted copy assignment operator. (pair): Derive from __pair_base. (pair::operator=): Remove deleted overload. * python/libstdcxx/v6/printers.py (StdPairPrinter): New pretty printer so that new base class isn't shown in GDB. * testsuite/20_util/pair/86751.cc: New test. * testsuite/20_util/pair/ref_assign.cc: New test. From-SVN: r265162
2018-10-15backport: [multiple changes]Richard Biener5-6/+101
2018-10-15 Richard Biener <rguenther@suse.de> Backport from mainline 2018-08-23 Richard Biener <rguenther@suse.de> PR middle-end/87024 * tree-inline.c (copy_bb): Drop unused __builtin_va_arg_pack_len calls. * gcc.dg/pr87024.c: New testcase. 2018-08-17 Richard Biener <rguenther@suse.de> PR middle-end/86505 * tree-inline.c (copy_bb): When inlining __builtin_va_arg_pack_len () across a va-arg-pack using call adjust its return value accordingly. * gcc.dg/torture/pr86505.c: New testcase. From-SVN: r265159
2018-10-15Daily bump.GCC Administrator1-1/+1
From-SVN: r265152
2018-10-14Daily bump.GCC Administrator1-1/+1
From-SVN: r265143
2018-10-13Daily bump.GCC Administrator1-1/+1
From-SVN: r265136
2018-10-12backport: re PR target/87550 (Intrinsics for rdpmc (__rdpmc, ↵Jakub Jelinek4-1/+34
__builtin_ia32_rdpmc) are interpreted as pure functions) Backported from mainline 2018-10-10 Jakub Jelinek <jakub@redhat.com> PR target/87550 * config/i386/i386.c (bdesc_args): Move IX86_BUILTIN_RDPMC from here to ... (bdesc_special_args): ... here. * gcc.target/i386/pr87550.c: New test. From-SVN: r265122
2018-10-12backport: re PR middle-end/87248 (Bad code for masked operations involving ↵Jakub Jelinek4-3/+56
signed ints) Backported from mainline 2018-09-12 Jakub Jelinek <jakub@redhat.com> PR middle-end/87248 * fold-const.c (fold_ternary_loc) <case COND_EXPR>: Verify also that BIT_AND_EXPR's second operand is a power of two. Formatting fix. * c-c++-common/torture/pr87248.c: New test. From-SVN: r265121
2018-10-12backport: re PR rtl-optimization/87065 (combine causes ICE in ↵Jakub Jelinek4-5/+42
trunc_int_for_mode) Backported from mainline 2018-08-27 Jakub Jelinek <jakub@redhat.com> PR rtl-optimization/87065 * combine.c (simplify_if_then_else): Formatting fix. (if_then_else_cond): Guard MULT optimization with SCALAR_INT_MODE_P check. (known_cond): Don't return const_true_rtx for vector modes. Use CONST0_RTX instead of const0_rtx. Formatting fixes. * gcc.target/i386/pr87065.c: New test. From-SVN: r265120
2018-10-12backport: re PR middle-end/86627 (Signed 128-bit division by 2 no longer ↵Jakub Jelinek4-3/+46
expanded to RTL) Backported from mainline 2018-07-24 Jakub Jelinek <jakub@redhat.com> PR middle-end/86627 * expmed.c (expand_divmod): Punt if d == HOST_WIDE_INT_MIN and size > HOST_BITS_PER_WIDE_INT. For size > HOST_BITS_PER_WIDE_INT and abs_d == d, do the power of two handling if profitable. * gcc.target/i386/pr86627.c: New test. From-SVN: r265119
2018-10-12backport: re PR middle-end/86542 (wrong-code for collapsed taskloop which ↵Jakub Jelinek4-1/+58
needs omp_cpyfn) Backported from mainline 2018-07-17 Jakub Jelinek <jakub@redhat.com> PR middle-end/86542 * omp-low.c (create_task_copyfn): Copy over also fields corresponding to _looptemp_ clauses, other than the first two. * testsuite/libgomp.c++/pr86542.C: New test. From-SVN: r265118
2018-10-12backport: re PR middle-end/86539 (OpenMP wrong-code with taskloop and ↵Jakub Jelinek4-1/+73
references) Backported from mainline 2018-07-17 Jakub Jelinek <jakub@redhat.com> PR middle-end/86539 * gimplify.c (gimplify_omp_for): Ensure taskloop firstprivatized init and cond temporaries don't have reference type if iterator has pointer type. For init use &for_pre_body instead of pre_p if for_pre_body is non-empty. * testsuite/libgomp.c++/pr86539.C: New test. From-SVN: r265117
2018-10-12backport: re PR middle-end/86660 (libgomp.c++/for-15.C ICEs with nvptx ↵Jakub Jelinek4-1/+50
offloading) Backported from mainline 2018-07-26 Jakub Jelinek <jakub@redhat.com> PR middle-end/86660 * omp-low.c (scan_sharing_clauses): Don't ignore map clauses for declare target to variables if they have always,{to,from,tofrom} map kinds. * testsuite/libgomp.c/pr86660.c: New test. From-SVN: r265116
2018-10-12backport: re PR c++/3698 (improper handling of an extern declared inline ↵Jakub Jelinek4-0/+41
function) Backported from mainline 2018-07-16 Jakub Jelinek <jakub@redhat.com> PR c++/3698 PR c++/86208 * cp-gimplify.c (cp_genericize_r): When using extern_decl_map, or in TREE_USED flag from stmt to h->to. * g++.dg/opt/pr3698.C: New test. From-SVN: r265115
2018-10-12backport: [multiple changes]Richard Biener4-23/+180
2018-10-12 Richard Biener <rguenther@suse.de> PR c++/54278 Backport from mainline 2017-03-23 Richard Biener <rguenther@suse.de> PR tree-optimization/80032 * gimplify.c (gimple_push_cleanup): Forced unconditional cleanups still have to go to the conditional_cleanups sequence. 2017-03-21 Richard Biener <rguenther@suse.de> PR tree-optimization/80032 * gimplify.c (gimple_push_cleanup): Add force_uncond parameter, if set force the cleanup to happen unconditionally. (gimplify_target_expr): Push inserted clobbers with force_uncond to avoid them being removed by control-dependent DCE. * g++.dg/opt/pr80032.C: New testcase. From-SVN: r265101
2018-10-12Fix __gnu_cxx::_Pointer_adapter for long long arithmeticJonathan Wakely3-0/+28
Backport from mainline 2018-08-30 Jonathan Wakely <jwakely@redhat.com> * include/ext/pointer.h (_Pointer_adapter): Define operators for pointer arithmetic using long long offsets. * testsuite/ext/ext_pointer/1.cc: Test pointer arithmetic using long long values. From-SVN: r265099
2018-10-12Fix experimental::pmr typedefs and add testsJonathan Wakely17-6/+572
The typedefs in <experimental/regex> and <experimental/string> don't need to be in the __cxx11 namespace, because they are only aliases and so will have the same mangled name as the underlying types. Backport from mainline 2018-08-22 Jonathan Wakely <jwakely@redhat.com> PR libstdc++/87061 * include/experimental/regex [!_GLIBCXX_USE_CXX11_ABI] (experimental::pmr::match_results, experimental::pmr::cmatch) (experimental::pmr::smatch, experimental::pmr::wcmatch) (experimental::pmr::wsmatch): Do not declare for gcc4-compatible ABI, because COW strings don't support C++11 allocator model. * include/experimental/string [!_GLIBCXX_USE_CXX11_ABI] (experimental::pmr::basic_string, experimental::pmr::string) (experimental::pmr::u16string, experimental::pmr::u32string) (experimental::pmr::wstring): Likewise. Backport from mainline 2018-08-15 Jonathan Wakely <jwakely@redhat.com> * include/experimental/regex: Remove begin/end macros for namespace. * include/experimental/string: Likewise. * testsuite/experimental/polymorphic_allocator/pmr_typedefs_deque.cc: New test. * testsuite/experimental/polymorphic_allocator/ pmr_typedefs_forward_list.cc: New test. * testsuite/experimental/polymorphic_allocator/pmr_typedefs_list.cc: New test. * testsuite/experimental/polymorphic_allocator/pmr_typedefs_map.cc: New test. * testsuite/experimental/polymorphic_allocator/pmr_typedefs_match.cc: New test. * testsuite/experimental/polymorphic_allocator/ pmr_typedefs_multimap.cc: New test. * testsuite/experimental/polymorphic_allocator/ pmr_typedefs_multiset.cc: New test. * testsuite/experimental/polymorphic_allocator/pmr_typedefs_set.cc: New test. * testsuite/experimental/polymorphic_allocator/pmr_typedefs_string.cc: New test. * testsuite/experimental/polymorphic_allocator/ pmr_typedefs_unordered_map.cc: New test. * testsuite/experimental/polymorphic_allocator/ pmr_typedefs_unordered_multimap.cc: New test. * testsuite/experimental/polymorphic_allocator/ pmr_typedefs_unordered_multiset.cc: New test. * testsuite/experimental/polymorphic_allocator/ pmr_typedefs_unordered_set.cc: New test. * testsuite/experimental/polymorphic_allocator/pmr_typedefs_vector.cc: New test. From-SVN: r265098
2018-10-12PR libstdc++/70966 make pmr::new_delete_resource() immortalJonathan Wakely3-25/+120
Construct the program-wide resource objects using placement new. This means they have dynamic storage duration and won't be destroyed during termination. Backport from mainline 2018-07-24 Jonathan Wakely <jwakely@redhat.com> PR libstdc++/70966 * include/experimental/memory_resource (__get_default_resource): Use placement new to create an object with dynamic storage duration. Backport from mainline 2018-06-20 Jonathan Wakely <jwakely@redhat.com> PR libstdc++/70966 * include/experimental/memory_resource (__resource_adaptor_imp): Add static assertions to enforce requirements on pointer types. (__resource_adaptor_imp::get_allocator()): Add noexcept. (new_delete_resource, null_memory_resource): Return address of an object with dynamic storage duration. (__null_memory_resource): Remove. * testsuite/experimental/memory_resource/70966.cc: New. From-SVN: r265097
2018-10-12i386: Correct _mm512_mask3_fmaddsub_round_pdH.J. Lu2-1/+10
Define _mm512_mask3_fmaddsub_round_pd with __builtin_ia32_vfmaddsubpd512_mask, instead of __builtin_ia32_vfmaddpd512_mask. Backport from mainline PR target/87517 * config/i386/avx512fintrin.h (_mm512_mask_fmaddsub_round_pd): Defined with __builtin_ia32_vfmaddsubpd512_mask. From-SVN: r265091
2018-10-12i386: Don't pass -msse2avx to assembler for -mavxH.J. Lu3-2/+12
With gcc -O2 -fPIC -flto -g -c -o a.o a.c gcc -O2 -fPIC -flto -g -mavx -c -o b.o b.c gcc -shared -O2 -fPIC -flto -g -o lib1.so a.o b.o LTO correctly generates AVX for b.o and SSE for a.o. But the GCC driver passes -msse2avx to assembler, which encodes SSE instructions as AVX instructions. We shouldn't pass -msse2avx to assembler for -mavx. Backport from mainline PR target/87522 * config/i386/gnu-user.h (ASM_SPEC): Don't pass -msse2avx to assembler for -mavx. * config/i386/gnu-user64.h (ASM_SPEC): Likewise. From-SVN: r265090
2018-10-12PR libstdc++/77854 document size_type for containersJonathan Wakely3-0/+14
PR libstdc++/77854 * doc/xml/manual/status_cxx1998.xml: Document size_type and difference_type for containers. * doc/html/*: Regenerate. From-SVN: r265084
2018-10-12PR libstdc++/85098 add missing definitions for static constantsJonathan Wakely4-1/+101
In C++11 and C++14 any odr-use of these constants requires a definition at namespace-scope. In C++17 they are implicitly inline and so the namespace-scope redeclarations are redundant (and allowing them is deprecated). Backport from mainline 2018-05-18 Jonathan Wakely <jwakely@redhat.com> PR libstdc++/85098 * include/bits/regex.h [__cplusplus < 201703L] (basic_regex::icase) (basic_regex::nosubs, basic_regex::optimize, basic_regex::collate) (basic_regex::ECMAScript, basic_regex::basic, basic_regex::extended) (basic_regex::awk, basic_regex::grep, basic_regex::egrep): Add definitions. * include/bits/regex_automaton.h (_NFA::_M_insert_state): Adjust whitespace. * testsuite/28_regex/basic_regex/85098.cc: New From-SVN: r265083
2018-10-12Daily bump.GCC Administrator1-1/+1
From-SVN: r265069
2018-10-11Daily bump.GCC Administrator1-1/+1
From-SVN: r265029
2018-10-10Daily bump.GCC Administrator1-1/+1
From-SVN: r265000
2018-10-09Use -fno-show-column in libstdc++ installed testing.Joseph Myers2-1/+9
<https://gcc.gnu.org/ml/libstdc++/2016-08/msg00006.html> arranged for libstdc++ tests to use -fno-show-column by default, but only for build-tree testing. This patch adds it to the options used for installed testing as well. Tested with installed testing for a cross to x86_64-linux-gnu, where it fixes various test failures. Backport from mainline 2018-10-02 Joseph Myers <joseph@codesourcery.com> * testsuite/lib/libstdc++.exp (libstdc++_init): Use -fno-show-column in default cxxflags. From-SVN: r264955
2018-10-09Daily bump.GCC Administrator1-1/+1
From-SVN: r264945
2018-10-08Daily bump.GCC Administrator1-1/+1
From-SVN: r264907
2018-10-07Daily bump.GCC Administrator1-1/+1
From-SVN: r264903
2018-10-06Daily bump.GCC Administrator1-1/+1
From-SVN: r264893