Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package llvm15 for openSUSE:Factory checked in at 2023-01-21 19:09:53 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/llvm15 (Old) and /work/SRC/openSUSE:Factory/.llvm15.new.32243 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "llvm15" Sat Jan 21 19:09:53 2023 rev:7 rq:1059871 version:15.0.7 Changes: -------- --- /work/SRC/openSUSE:Factory/llvm15/llvm15.changes 2022-12-07 17:33:28.744050952 +0100 +++ /work/SRC/openSUSE:Factory/.llvm15.new.32243/llvm15.changes 2023-01-21 19:09:56.408743207 +0100 @@ -1,0 +2,14 @@ +Sat Jan 14 14:06:38 UTC 2023 - Aaron Puchert <aaronpuch...@alice-dsl.net> + +- Update to version 15.0.7. + * This release contains bug-fixes for the LLVM 15.0.0 release. + This release is API and ABI compatible with 15.0.0. +- Rebase llvm-do-not-install-static-libraries.patch. +- Build stage 2 with -fno-plt on x86_64: since building with + -Wl,-z,now the PLT stubs are basically dead code, so eliminating + the indirection reduces the number of branches and improves code + locality for the quite frequent cross-DSO calls. +- Add llvm-workaround-superfluous-branches.patch: hints LLVM to + eliminate branches until gh#llvm/llvm-project#28804 is solved. + +------------------------------------------------------------------- Old: ---- clang-15.0.6.src.tar.xz clang-docs-15.0.6.src.tar.xz clang-tools-extra-15.0.6.src.tar.xz cmake-15.0.6.src.tar.xz compiler-rt-15.0.6.src.tar.xz libcxx-15.0.6.src.tar.xz libcxxabi-15.0.6.src.tar.xz lld-15.0.6.src.tar.xz lldb-15.0.6.src.tar.xz llvm-15.0.6.src.tar.xz llvm-docs-15.0.6.src.tar.xz openmp-15.0.6.src.tar.xz polly-15.0.6.src.tar.xz New: ---- clang-15.0.7.src.tar.xz clang-docs-15.0.7.src.tar.xz clang-tools-extra-15.0.7.src.tar.xz cmake-15.0.7.src.tar.xz compiler-rt-15.0.7.src.tar.xz libcxx-15.0.7.src.tar.xz libcxxabi-15.0.7.src.tar.xz lld-15.0.7.src.tar.xz lldb-15.0.7.src.tar.xz llvm-15.0.7.src.tar.xz llvm-docs-15.0.7.src.tar.xz llvm-workaround-superfluous-branches.patch openmp-15.0.7.src.tar.xz polly-15.0.7.src.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ llvm15.spec ++++++ --- /var/tmp/diff_new_pack.GW6u2s/_old 2023-01-21 19:09:59.908763188 +0100 +++ /var/tmp/diff_new_pack.GW6u2s/_new 2023-01-21 19:09:59.912763211 +0100 @@ -1,7 +1,7 @@ # # spec file for package llvm15 # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,14 +16,14 @@ # -%define _relver 15.0.6 +%define _relver 15.0.7 %define _version %_relver%{?_rc:rc%_rc} %define _tagver %_relver%{?_rc:-rc%_rc} %define _minor 15.0 %define _sonum 15 %define _itsme15 1 # Integer version used by update-alternatives -%define _uaver 1506 +%define _uaver 1507 %define _soclang 13 %define _socxx 1 @@ -367,6 +367,8 @@ Patch14: llvm-do-not-install-static-libraries.patch # PATCH-FIX-OPENSUSE (or -UPSTREAM?): we disable RPATHs, but the test driver drops LD_LIBRARY_PATH. Patch15: libcxx-test-library-path.patch +# PATCH-FIX-UPSTREAM (?): Work around gh#llvm/llvm-project#28804 by hinting with __builtin_assume. +Patch16: llvm-workaround-superfluous-branches.patch Patch20: llvm_build_tablegen_component_as_shared_library.patch Patch21: tests-use-python3.patch Patch22: llvm-better-detect-64bit-atomics-support.patch @@ -807,6 +809,7 @@ %patch5 -p1 %patch13 -p1 %patch14 -p1 +%patch16 -p2 %patch20 -p1 %patch21 -p1 %patch22 -p1 @@ -979,6 +982,15 @@ then flags=$(echo %flags | sed 's/-fstack-clash-protection//'); fi +# 4) Add -fno-plt: With -Wl,-z,now the PLT is basically dead code, so we can +# now go the direct route for quite frequent cross-DSO calls. This reduces +# branches in a typical execution by ~5 percent, instructions/cycles +# by ~4 percent, and reduces pressure on the instruction cache. We do this +# only on x86_64 where it doesn't increase the code size significantly. +%ifarch x86_64 +flags="$flags -fno-plt" +%endif + CFLAGS=$flags CXXFLAGS=$flags ++++++ clang-15.0.6.src.tar.xz -> clang-15.0.7.src.tar.xz ++++++ /work/SRC/openSUSE:Factory/llvm15/clang-15.0.6.src.tar.xz /work/SRC/openSUSE:Factory/.llvm15.new.32243/clang-15.0.7.src.tar.xz differ: char 13, line 1 ++++++ clang-docs-15.0.6.src.tar.xz -> clang-docs-15.0.7.src.tar.xz ++++++ ++++ 2891 lines of diff (skipped) ++++++ clang-tools-extra-15.0.6.src.tar.xz -> clang-tools-extra-15.0.7.src.tar.xz ++++++ ++++++ cmake-15.0.6.src.tar.xz -> cmake-15.0.7.src.tar.xz ++++++ ++++++ compiler-rt-15.0.6.src.tar.xz -> compiler-rt-15.0.7.src.tar.xz ++++++ ++++++ libcxx-15.0.6.src.tar.xz -> libcxx-15.0.7.src.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libcxx-15.0.6.src/include/__config new/libcxx-15.0.7.src/include/__config --- old/libcxx-15.0.6.src/include/__config 2022-11-29 11:05:58.000000000 +0100 +++ new/libcxx-15.0.7.src/include/__config 2023-01-12 08:12:30.000000000 +0100 @@ -36,7 +36,7 @@ #ifdef __cplusplus -# define _LIBCPP_VERSION 15006 +# define _LIBCPP_VERSION 15007 # define _LIBCPP_CONCAT_IMPL(_X, _Y) _X##_Y # define _LIBCPP_CONCAT(_X, _Y) _LIBCPP_CONCAT_IMPL(_X, _Y) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libcxx-15.0.6.src/include/__support/musl/xlocale.h new/libcxx-15.0.7.src/include/__support/musl/xlocale.h --- old/libcxx-15.0.6.src/include/__support/musl/xlocale.h 2022-11-29 11:05:58.000000000 +0100 +++ new/libcxx-15.0.7.src/include/__support/musl/xlocale.h 2023-01-12 08:12:30.000000000 +0100 @@ -39,7 +39,7 @@ return ::wcstoll(__nptr, __endptr, __base); } -inline _LIBCPP_HIDE_FROM_ABI long long +inline _LIBCPP_HIDE_FROM_ABI unsigned long long wcstoull_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) { return ::wcstoull(__nptr, __endptr, __base); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libcxx-15.0.6.src/include/vector new/libcxx-15.0.7.src/include/vector --- old/libcxx-15.0.6.src/include/vector 2022-11-29 11:05:58.000000000 +0100 +++ new/libcxx-15.0.7.src/include/vector 2023-01-12 08:12:30.000000000 +0100 @@ -297,6 +297,7 @@ #include <__utility/forward.h> #include <__utility/move.h> #include <__utility/swap.h> +#include <__utility/transaction.h> #include <climits> #include <cstdlib> #include <cstring> @@ -425,18 +426,27 @@ value_type, typename iterator_traits<_ForwardIterator>::reference>::value>::type* = 0); - _LIBCPP_CONSTEXPR_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY - ~vector() - { - __annotate_delete(); - std::__debug_db_erase_c(this); - - if (this->__begin_ != nullptr) - { - __clear(); - __alloc_traits::deallocate(__alloc(), this->__begin_, capacity()); +private: + class __destroy_vector { + public: + _LIBCPP_CONSTEXPR __destroy_vector(vector& __vec) : __vec_(__vec) {} + + _LIBCPP_CONSTEXPR_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI void operator()() { + __vec_.__annotate_delete(); + std::__debug_db_erase_c(std::addressof(__vec_)); + + if (__vec_.__begin_ != nullptr) { + __vec_.__clear(); + __alloc_traits::deallocate(__vec_.__alloc(), __vec_.__begin_, __vec_.capacity()); + } } - } + + private: + vector& __vec_; + }; + +public: + _LIBCPP_CONSTEXPR_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI ~vector() { __destroy_vector(*this)(); } _LIBCPP_CONSTEXPR_AFTER_CXX17 vector(const vector& __x); _LIBCPP_CONSTEXPR_AFTER_CXX17 vector(const vector& __x, const __type_identity_t<allocator_type>& __a); @@ -1075,12 +1085,14 @@ _LIBCPP_CONSTEXPR_AFTER_CXX17 vector<_Tp, _Allocator>::vector(size_type __n) { - _VSTD::__debug_db_insert_c(this); + auto __guard = std::__make_transaction(__destroy_vector(*this)); + std::__debug_db_insert_c(this); if (__n > 0) { __vallocate(__n); __construct_at_end(__n); } + __guard.__complete(); } #if _LIBCPP_STD_VER > 11 @@ -1089,12 +1101,14 @@ vector<_Tp, _Allocator>::vector(size_type __n, const allocator_type& __a) : __end_cap_(nullptr, __a) { - _VSTD::__debug_db_insert_c(this); + auto __guard = std::__make_transaction(__destroy_vector(*this)); + std::__debug_db_insert_c(this); if (__n > 0) { __vallocate(__n); __construct_at_end(__n); } + __guard.__complete(); } #endif @@ -1102,12 +1116,14 @@ _LIBCPP_CONSTEXPR_AFTER_CXX17 vector<_Tp, _Allocator>::vector(size_type __n, const value_type& __x) { - _VSTD::__debug_db_insert_c(this); + auto __guard = std::__make_transaction(__destroy_vector(*this)); + std::__debug_db_insert_c(this); if (__n > 0) { __vallocate(__n); __construct_at_end(__n, __x); } + __guard.__complete(); } template <class _Tp, class _Allocator> @@ -1120,9 +1136,11 @@ typename iterator_traits<_InputIterator>::reference>::value, _InputIterator>::type __last) { - _VSTD::__debug_db_insert_c(this); + auto __guard = std::__make_transaction(__destroy_vector(*this)); + std::__debug_db_insert_c(this); for (; __first != __last; ++__first) emplace_back(*__first); + __guard.__complete(); } template <class _Tp, class _Allocator> @@ -1135,9 +1153,11 @@ typename iterator_traits<_InputIterator>::reference>::value>::type*) : __end_cap_(nullptr, __a) { - _VSTD::__debug_db_insert_c(this); + auto __guard = std::__make_transaction(__destroy_vector(*this)); + std::__debug_db_insert_c(this); for (; __first != __last; ++__first) emplace_back(*__first); + __guard.__complete(); } template <class _Tp, class _Allocator> @@ -1150,13 +1170,15 @@ typename iterator_traits<_ForwardIterator>::reference>::value, _ForwardIterator>::type __last) { - _VSTD::__debug_db_insert_c(this); - size_type __n = static_cast<size_type>(_VSTD::distance(__first, __last)); + auto __guard = std::__make_transaction(__destroy_vector(*this)); + std::__debug_db_insert_c(this); + size_type __n = static_cast<size_type>(std::distance(__first, __last)); if (__n > 0) { __vallocate(__n); __construct_at_end(__first, __last, __n); } + __guard.__complete(); } template <class _Tp, class _Allocator> @@ -1169,13 +1191,15 @@ typename iterator_traits<_ForwardIterator>::reference>::value>::type*) : __end_cap_(nullptr, __a) { - _VSTD::__debug_db_insert_c(this); - size_type __n = static_cast<size_type>(_VSTD::distance(__first, __last)); + auto __guard = std::__make_transaction(__destroy_vector(*this)); + std::__debug_db_insert_c(this); + size_type __n = static_cast<size_type>(std::distance(__first, __last)); if (__n > 0) { __vallocate(__n); __construct_at_end(__first, __last, __n); } + __guard.__complete(); } template <class _Tp, class _Allocator> @@ -1183,13 +1207,15 @@ vector<_Tp, _Allocator>::vector(const vector& __x) : __end_cap_(nullptr, __alloc_traits::select_on_container_copy_construction(__x.__alloc())) { - _VSTD::__debug_db_insert_c(this); + auto __guard = std::__make_transaction(__destroy_vector(*this)); + std::__debug_db_insert_c(this); size_type __n = __x.size(); if (__n > 0) { __vallocate(__n); __construct_at_end(__x.__begin_, __x.__end_, __n); } + __guard.__complete(); } template <class _Tp, class _Allocator> @@ -1197,13 +1223,15 @@ vector<_Tp, _Allocator>::vector(const vector& __x, const __type_identity_t<allocator_type>& __a) : __end_cap_(nullptr, __a) { - _VSTD::__debug_db_insert_c(this); + auto __guard = std::__make_transaction(__destroy_vector(*this)); + std::__debug_db_insert_c(this); size_type __n = __x.size(); if (__n > 0) { __vallocate(__n); __construct_at_end(__x.__begin_, __x.__end_, __n); } + __guard.__complete(); } template <class _Tp, class _Allocator> @@ -1243,7 +1271,9 @@ else { typedef move_iterator<iterator> _Ip; + auto __guard = std::__make_transaction(__destroy_vector(*this)); assign(_Ip(__x.begin()), _Ip(__x.end())); + __guard.__complete(); } } @@ -1254,12 +1284,14 @@ inline _LIBCPP_INLINE_VISIBILITY vector<_Tp, _Allocator>::vector(initializer_list<value_type> __il) { - _VSTD::__debug_db_insert_c(this); + auto __guard = std::__make_transaction(__destroy_vector(*this)); + std::__debug_db_insert_c(this); if (__il.size() > 0) { __vallocate(__il.size()); __construct_at_end(__il.begin(), __il.end(), __il.size()); } + __guard.__complete(); } template <class _Tp, class _Allocator> @@ -1268,12 +1300,14 @@ vector<_Tp, _Allocator>::vector(initializer_list<value_type> __il, const allocator_type& __a) : __end_cap_(nullptr, __a) { - _VSTD::__debug_db_insert_c(this); + auto __guard = std::__make_transaction(__destroy_vector(*this)); + std::__debug_db_insert_c(this); if (__il.size() > 0) { __vallocate(__il.size()); __construct_at_end(__il.begin(), __il.end(), __il.size()); } + __guard.__complete(); } #endif // _LIBCPP_CXX03_LANG @@ -2111,8 +2145,26 @@ #else _NOEXCEPT; #endif - _LIBCPP_CONSTEXPR_AFTER_CXX17 ~vector(); - _LIBCPP_CONSTEXPR_AFTER_CXX17 explicit vector(size_type __n); + +private: + class __destroy_vector { + public: + _LIBCPP_CONSTEXPR __destroy_vector(vector& __vec) : __vec_(__vec) {} + + _LIBCPP_CONSTEXPR_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI void operator()() { + if (__vec_.__begin_ != nullptr) + __storage_traits::deallocate(__vec_.__alloc(), __vec_.__begin_, __vec_.__cap()); + std::__debug_db_invalidate_all(this); + } + + private: + vector& __vec_; + }; + +public: + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 ~vector() { __destroy_vector(*this)(); } + + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 explicit vector(size_type __n); #if _LIBCPP_STD_VER > 11 _LIBCPP_CONSTEXPR_AFTER_CXX17 explicit vector(size_type __n, const allocator_type& __a); #endif @@ -2647,12 +2699,14 @@ __size_(0), __cap_alloc_(0, __default_init_tag()) { - size_type __n = static_cast<size_type>(_VSTD::distance(__first, __last)); + auto __guard = std::__make_transaction(__destroy_vector(*this)); + size_type __n = static_cast<size_type>(std::distance(__first, __last)); if (__n > 0) { __vallocate(__n); __construct_at_end(__first, __last); } + __guard.__complete(); } template <class _Allocator> @@ -2664,12 +2718,14 @@ __size_(0), __cap_alloc_(0, static_cast<__storage_allocator>(__a)) { - size_type __n = static_cast<size_type>(_VSTD::distance(__first, __last)); + auto __guard = std::__make_transaction(__destroy_vector(*this)); + size_type __n = static_cast<size_type>(std::distance(__first, __last)); if (__n > 0) { __vallocate(__n); __construct_at_end(__first, __last); } + __guard.__complete(); } #ifndef _LIBCPP_CXX03_LANG @@ -2708,15 +2764,6 @@ template <class _Allocator> _LIBCPP_CONSTEXPR_AFTER_CXX17 -vector<bool, _Allocator>::~vector() -{ - if (__begin_ != nullptr) - __storage_traits::deallocate(__alloc(), __begin_, __cap()); - std::__debug_db_invalidate_all(this); -} - -template <class _Allocator> -_LIBCPP_CONSTEXPR_AFTER_CXX17 vector<bool, _Allocator>::vector(const vector& __v) : __begin_(nullptr), __size_(0), diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libcxx-15.0.6.src/test/std/containers/sequences/vector/vector.cons/exceptions.pass.cpp new/libcxx-15.0.7.src/test/std/containers/sequences/vector/vector.cons/exceptions.pass.cpp --- old/libcxx-15.0.6.src/test/std/containers/sequences/vector/vector.cons/exceptions.pass.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/libcxx-15.0.7.src/test/std/containers/sequences/vector/vector.cons/exceptions.pass.cpp 2023-01-12 08:12:30.000000000 +0100 @@ -0,0 +1,229 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: no-exceptions + +// (bug report: https://llvm.org/PR58392) +// Check that vector constructors don't leak memory when an operation inside the constructor throws an exception + +#include <type_traits> +#include <vector> + +#include "count_new.h" +#include "test_iterators.h" + +template <class T> +struct Allocator { + using value_type = T; + using is_always_equal = std::false_type; + + Allocator(bool should_throw = true) { + if (should_throw) + throw 0; + } + + T* allocate(int n) { return std::allocator<T>().allocate(n); } + void deallocate(T* ptr, int n) { std::allocator<T>().deallocate(ptr, n); } + + friend bool operator==(const Allocator&, const Allocator&) { return false; } +}; + +struct ThrowingT { + int* throw_after_n_ = nullptr; + ThrowingT() { throw 0; } + + ThrowingT(int& throw_after_n) : throw_after_n_(&throw_after_n) { + if (throw_after_n == 0) + throw 0; + --throw_after_n; + } + + ThrowingT(const ThrowingT&) { + if (throw_after_n_ == nullptr || *throw_after_n_ == 0) + throw 1; + --*throw_after_n_; + } + + ThrowingT& operator=(const ThrowingT&) { + if (throw_after_n_ == nullptr || *throw_after_n_ == 0) + throw 1; + --*throw_after_n_; + return *this; + } +}; + +template <class IterCat> +struct Iterator { + using iterator_category = IterCat; + using difference_type = std::ptrdiff_t; + using value_type = int; + using reference = int&; + using pointer = int*; + + int i_; + Iterator(int i = 0) : i_(i) {} + int& operator*() { + if (i_ == 1) + throw 1; + return i_; + } + + friend bool operator==(const Iterator& lhs, const Iterator& rhs) { return lhs.i_ == rhs.i_; } + + friend bool operator!=(const Iterator& lhs, const Iterator& rhs) { return lhs.i_ != rhs.i_; } + + Iterator& operator++() { + ++i_; + return *this; + } + + Iterator operator++(int) { + auto tmp = *this; + ++i_; + return tmp; + } +}; + +void check_new_delete_called() { + assert(globalMemCounter.new_called == globalMemCounter.delete_called); + assert(globalMemCounter.new_array_called == globalMemCounter.delete_array_called); + assert(globalMemCounter.aligned_new_called == globalMemCounter.aligned_delete_called); + assert(globalMemCounter.aligned_new_array_called == globalMemCounter.aligned_delete_array_called); +} + +int main(int, char**) { + using AllocVec = std::vector<int, Allocator<int> >; + try { // vector() + AllocVec vec; + } catch (int) { + } + check_new_delete_called(); + + try { // Throw in vector(size_type) from type + std::vector<ThrowingT> get_alloc(1); + } catch (int) { + } + check_new_delete_called(); + +#if TEST_STD_VER >= 14 + try { // Throw in vector(size_type, value_type) from type + int throw_after = 1; + ThrowingT v(throw_after); + std::vector<ThrowingT> get_alloc(1, v); + } catch (int) { + } + check_new_delete_called(); + + try { // Throw in vector(size_type, const allocator_type&) from allocator + Allocator<int> alloc(false); + AllocVec get_alloc(0, alloc); + } catch (int) { + } + check_new_delete_called(); + + try { // Throw in vector(size_type, const allocator_type&) from the type + std::vector<ThrowingT> vec(1, std::allocator<ThrowingT>()); + } catch (int) { + } + check_new_delete_called(); +#endif // TEST_STD_VER >= 14 + + try { // Throw in vector(InputIterator, InputIterator) from input iterator + std::vector<int> vec((Iterator<std::input_iterator_tag>()), Iterator<std::input_iterator_tag>(2)); + } catch (int) { + } + check_new_delete_called(); + + try { // Throw in vector(InputIterator, InputIterator) from forward iterator + std::vector<int> vec((Iterator<std::forward_iterator_tag>()), Iterator<std::forward_iterator_tag>(2)); + } catch (int) { + } + check_new_delete_called(); + + try { // Throw in vector(InputIterator, InputIterator) from allocator + int a[] = {1, 2}; + AllocVec vec(cpp17_input_iterator<int*>(a), cpp17_input_iterator<int*>(a + 2)); + } catch (int) { + } + check_new_delete_called(); + + try { // Throw in vector(InputIterator, InputIterator, const allocator_type&) from input iterator + std::allocator<int> alloc; + std::vector<int> vec(Iterator<std::input_iterator_tag>(), Iterator<std::input_iterator_tag>(2), alloc); + } catch (int) { + } + check_new_delete_called(); + + try { // Throw in vector(InputIterator, InputIterator, const allocator_type&) from forward iterator + std::allocator<int> alloc; + std::vector<int> vec(Iterator<std::forward_iterator_tag>(), Iterator<std::forward_iterator_tag>(2), alloc); + } catch (int) { + } + check_new_delete_called(); + + try { // Throw in vector(InputIterator, InputIterator, const allocator_type&) from allocator + int a[] = {1, 2}; + Allocator<int> alloc(false); + AllocVec vec(cpp17_input_iterator<int*>(a), cpp17_input_iterator<int*>(a + 2), alloc); + } catch (int) { + } + check_new_delete_called(); + + try { // Throw in vector(InputIterator, InputIterator, const allocator_type&) from allocator + int a[] = {1, 2}; + Allocator<int> alloc(false); + AllocVec vec(forward_iterator<int*>(a), forward_iterator<int*>(a + 2), alloc); + } catch (int) { + } + check_new_delete_called(); + + try { // Throw in vector(const vector&) from type + std::vector<ThrowingT> vec; + int throw_after = 0; + vec.emplace_back(throw_after); + auto vec2 = vec; + } catch (int) { + } + check_new_delete_called(); + + try { // Throw in vector(const vector&, const allocator_type&) from type + std::vector<ThrowingT> vec; + int throw_after = 1; + vec.emplace_back(throw_after); + std::vector<ThrowingT> vec2(vec, std::allocator<int>()); + } catch (int) { + } + check_new_delete_called(); + + try { // Throw in vector(vector&&, const allocator_type&) from type + std::vector<ThrowingT, Allocator<ThrowingT> > vec(Allocator<ThrowingT>(false)); + int throw_after = 1; + vec.emplace_back(throw_after); + std::vector<ThrowingT, Allocator<ThrowingT> > vec2(std::move(vec), Allocator<ThrowingT>(false)); + } catch (int) { + } + check_new_delete_called(); + +#if TEST_STD_VER >= 11 + try { // Throw in vector(initializer_list<value_type>) from type + int throw_after = 1; + std::vector<ThrowingT> vec({ThrowingT(throw_after)}); + } catch (int) { + } + check_new_delete_called(); + + try { // Throw in vector(initializer_list<value_type>, const allocator_type&) constructor from type + int throw_after = 1; + std::vector<ThrowingT> vec({ThrowingT(throw_after)}, std::allocator<ThrowingT>()); + } catch (int) { + } + check_new_delete_called(); +#endif // TEST_STD_VER >= 11 + + return 0; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libcxx-15.0.6.src/test/std/containers/sequences/vector.bool/ctor_exceptions.pass.cpp new/libcxx-15.0.7.src/test/std/containers/sequences/vector.bool/ctor_exceptions.pass.cpp --- old/libcxx-15.0.6.src/test/std/containers/sequences/vector.bool/ctor_exceptions.pass.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/libcxx-15.0.7.src/test/std/containers/sequences/vector.bool/ctor_exceptions.pass.cpp 2023-01-12 08:12:30.000000000 +0100 @@ -0,0 +1,141 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: no-exceptions + +// (bug report: https://llvm.org/PR58392) +// Check that vector<bool> constructors don't leak memory when an operation inside the constructor throws an exception + +#include <type_traits> +#include <vector> + +#include "count_new.h" +#include "test_iterators.h" + +template <class T> +struct Allocator { + using value_type = T; + using is_always_equal = std::false_type; + + template <class U> + Allocator(const Allocator<U>&) {} + + Allocator(bool should_throw = true) { + if (should_throw) + throw 0; + } + + T* allocate(int n) { return std::allocator<T>().allocate(n); } + void deallocate(T* ptr, int n) { std::allocator<T>().deallocate(ptr, n); } + + friend bool operator==(const Allocator&, const Allocator&) { return false; } +}; + +template <class IterCat> +struct Iterator { + using iterator_category = IterCat; + using difference_type = std::ptrdiff_t; + using value_type = bool; + using reference = bool&; + using pointer = bool*; + + int i_; + bool b_ = true; + Iterator(int i = 0) : i_(i) {} + bool& operator*() { + if (i_ == 1) + throw 1; + return b_; + } + + friend bool operator==(const Iterator& lhs, const Iterator& rhs) { return lhs.i_ == rhs.i_; } + + friend bool operator!=(const Iterator& lhs, const Iterator& rhs) { return lhs.i_ != rhs.i_; } + + Iterator& operator++() { + ++i_; + return *this; + } + + Iterator operator++(int) { + auto tmp = *this; + ++i_; + return tmp; + } +}; + +void check_new_delete_called() { + assert(globalMemCounter.new_called == globalMemCounter.delete_called); + assert(globalMemCounter.new_array_called == globalMemCounter.delete_array_called); + assert(globalMemCounter.aligned_new_called == globalMemCounter.aligned_delete_called); + assert(globalMemCounter.aligned_new_array_called == globalMemCounter.aligned_delete_array_called); +} + +int main(int, char**) { + using AllocVec = std::vector<bool, Allocator<bool> >; + +#if TEST_STD_VER >= 14 + try { // Throw in vector(size_type, const allocator_type&) from allocator + Allocator<bool> alloc(false); + AllocVec get_alloc(0, alloc); + } catch (int) { + } + check_new_delete_called(); +#endif // TEST_STD_VER >= 14 + + try { // Throw in vector(InputIterator, InputIterator) from input iterator + std::vector<bool> vec((Iterator<std::input_iterator_tag>()), Iterator<std::input_iterator_tag>(2)); + } catch (int) { + } + check_new_delete_called(); + + try { // Throw in vector(InputIterator, InputIterator) from forward iterator + std::vector<bool> vec((Iterator<std::forward_iterator_tag>()), Iterator<std::forward_iterator_tag>(2)); + } catch (int) { + } + check_new_delete_called(); + + try { // Throw in vector(InputIterator, InputIterator) from allocator + int a[] = {1, 2}; + AllocVec vec(cpp17_input_iterator<int*>(a), cpp17_input_iterator<int*>(a + 2)); + } catch (int) { + } + check_new_delete_called(); + + try { // Throw in vector(InputIterator, InputIterator, const allocator_type&) from input iterator + std::allocator<bool> alloc; + std::vector<bool> vec(Iterator<std::input_iterator_tag>(), Iterator<std::input_iterator_tag>(2), alloc); + } catch (int) { + } + check_new_delete_called(); + + try { // Throw in vector(InputIterator, InputIterator, const allocator_type&) from forward iterator + std::allocator<bool> alloc; + std::vector<bool> vec(Iterator<std::forward_iterator_tag>(), Iterator<std::forward_iterator_tag>(2), alloc); + } catch (int) { + } + check_new_delete_called(); + + try { // Throw in vector(InputIterator, InputIterator, const allocator_type&) from allocator + bool a[] = {true, false}; + Allocator<bool> alloc(false); + AllocVec vec(cpp17_input_iterator<bool*>(a), cpp17_input_iterator<bool*>(a + 2), alloc); + } catch (int) { + } + check_new_delete_called(); + + try { // Throw in vector(InputIterator, InputIterator, const allocator_type&) from allocator + bool a[] = {true, false}; + Allocator<bool> alloc(false); + AllocVec vec(forward_iterator<bool*>(a), forward_iterator<bool*>(a + 2), alloc); + } catch (int) { + } + check_new_delete_called(); + + return 0; +} ++++++ libcxxabi-15.0.6.src.tar.xz -> libcxxabi-15.0.7.src.tar.xz ++++++ ++++++ lld-15.0.6.src.tar.xz -> lld-15.0.7.src.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lld-15.0.6.src/test/wasm/export-all.s new/lld-15.0.7.src/test/wasm/export-all.s --- old/lld-15.0.6.src/test/wasm/export-all.s 2022-11-29 11:05:58.000000000 +0100 +++ new/lld-15.0.7.src/test/wasm/export-all.s 2023-01-12 08:12:30.000000000 +0100 @@ -40,9 +40,12 @@ # CHECK-NEXT: - Name: __heap_base # CHECK-NEXT: Kind: GLOBAL # CHECK-NEXT: Index: 4 -# CHECK-NEXT: - Name: __memory_base +# CHECK-NEXT: - Name: __heap_end # CHECK-NEXT: Kind: GLOBAL # CHECK-NEXT: Index: 5 -# CHECK-NEXT: - Name: __table_base +# CHECK-NEXT: - Name: __memory_base # CHECK-NEXT: Kind: GLOBAL # CHECK-NEXT: Index: 6 +# CHECK-NEXT: - Name: __table_base +# CHECK-NEXT: Kind: GLOBAL +# CHECK-NEXT: Index: 7 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lld-15.0.6.src/test/wasm/mutable-global-exports.s new/lld-15.0.7.src/test/wasm/mutable-global-exports.s --- old/lld-15.0.6.src/test/wasm/mutable-global-exports.s 2022-11-29 11:05:58.000000000 +0100 +++ new/lld-15.0.7.src/test/wasm/mutable-global-exports.s 2023-01-12 08:12:30.000000000 +0100 @@ -79,10 +79,13 @@ # CHECK-ALL-NEXT: - Name: __heap_base # CHECK-ALL-NEXT: Kind: GLOBAL # CHECK-ALL-NEXT: Index: 5 -# CHECK-ALL-NEXT: - Name: __memory_base +# CHECK-ALL-NEXT: - Name: __heap_end # CHECK-ALL-NEXT: Kind: GLOBAL # CHECK-ALL-NEXT: Index: 6 -# CHECK-ALL-NEXT: - Name: __table_base +# CHECK-ALL-NEXT: - Name: __memory_base # CHECK-ALL-NEXT: Kind: GLOBAL # CHECK-ALL-NEXT: Index: 7 +# CHECK-ALL-NEXT: - Name: __table_base +# CHECK-ALL-NEXT: Kind: GLOBAL +# CHECK-ALL-NEXT: Index: 8 # CHECK-ALL-NEXT: - Type: CODE diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lld-15.0.6.src/wasm/Driver.cpp new/lld-15.0.7.src/wasm/Driver.cpp --- old/lld-15.0.6.src/wasm/Driver.cpp 2022-11-29 11:05:58.000000000 +0100 +++ new/lld-15.0.7.src/wasm/Driver.cpp 2023-01-12 08:12:30.000000000 +0100 @@ -681,6 +681,7 @@ if (!config->isPic) { WasmSym::globalBase = symtab->addOptionalDataSymbol("__global_base"); WasmSym::heapBase = symtab->addOptionalDataSymbol("__heap_base"); + WasmSym::heapEnd = symtab->addOptionalDataSymbol("__heap_end"); WasmSym::definedMemoryBase = symtab->addOptionalDataSymbol("__memory_base"); WasmSym::definedTableBase = symtab->addOptionalDataSymbol("__table_base"); if (config->is64.value_or(false)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lld-15.0.6.src/wasm/Symbols.cpp new/lld-15.0.7.src/wasm/Symbols.cpp --- old/lld-15.0.6.src/wasm/Symbols.cpp 2022-11-29 11:05:58.000000000 +0100 +++ new/lld-15.0.7.src/wasm/Symbols.cpp 2023-01-12 08:12:30.000000000 +0100 @@ -83,6 +83,7 @@ DefinedData *WasmSym::dataEnd; DefinedData *WasmSym::globalBase; DefinedData *WasmSym::heapBase; +DefinedData *WasmSym::heapEnd; DefinedData *WasmSym::initMemoryFlag; GlobalSymbol *WasmSym::stackPointer; GlobalSymbol *WasmSym::tlsBase; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lld-15.0.6.src/wasm/Symbols.h new/lld-15.0.7.src/wasm/Symbols.h --- old/lld-15.0.6.src/wasm/Symbols.h 2022-11-29 11:05:58.000000000 +0100 +++ new/lld-15.0.7.src/wasm/Symbols.h 2023-01-12 08:12:30.000000000 +0100 @@ -538,11 +538,14 @@ // Symbol marking the end of the data and bss. static DefinedData *dataEnd; - // __heap_base - // Symbol marking the end of the data, bss and explicit stack. Any linear - // memory following this address is not used by the linked code and can - // therefore be used as a backing store for brk()/malloc() implementations. + // __heap_base/__heap_end + // Symbols marking the beginning and end of the "heap". It starts at the end + // of the data, bss and explicit stack, and extends to the end of the linear + // memory allocated by wasm-ld. This region of memory is not used by the + // linked code, so it may be used as a backing store for `sbrk` or `malloc` + // implementations. static DefinedData *heapBase; + static DefinedData *heapEnd; // __wasm_init_memory_flag // Symbol whose contents are nonzero iff memory has already been initialized. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lld-15.0.6.src/wasm/Writer.cpp new/lld-15.0.7.src/wasm/Writer.cpp --- old/lld-15.0.6.src/wasm/Writer.cpp 2022-11-29 11:05:58.000000000 +0100 +++ new/lld-15.0.7.src/wasm/Writer.cpp 2023-01-12 08:12:30.000000000 +0100 @@ -340,10 +340,20 @@ Twine(maxMemorySetting)); memoryPtr = config->initialMemory; } - out.memorySec->numMemoryPages = - alignTo(memoryPtr, WasmPageSize) / WasmPageSize; + + memoryPtr = alignTo(memoryPtr, WasmPageSize); + + out.memorySec->numMemoryPages = memoryPtr / WasmPageSize; log("mem: total pages = " + Twine(out.memorySec->numMemoryPages)); + if (WasmSym::heapEnd) { + // Set `__heap_end` to follow the end of the statically allocated linear + // memory. The fact that this comes last means that a malloc/brk + // implementation can grow the heap at runtime. + log("mem: heap end = " + Twine(memoryPtr)); + WasmSym::heapEnd->setVA(memoryPtr); + } + if (config->maxMemory != 0) { if (config->maxMemory != alignTo(config->maxMemory, WasmPageSize)) error("maximum memory must be " + Twine(WasmPageSize) + "-byte aligned"); @@ -363,7 +373,7 @@ if (config->isPic) max = maxMemorySetting; else - max = alignTo(memoryPtr, WasmPageSize); + max = memoryPtr; } out.memorySec->maxMemoryPages = max / WasmPageSize; log("mem: max pages = " + Twine(out.memorySec->maxMemoryPages)); ++++++ lldb-15.0.6.src.tar.xz -> lldb-15.0.7.src.tar.xz ++++++ /work/SRC/openSUSE:Factory/llvm15/lldb-15.0.6.src.tar.xz /work/SRC/openSUSE:Factory/.llvm15.new.32243/lldb-15.0.7.src.tar.xz differ: char 13, line 1 ++++++ llvm-15.0.6.src.tar.xz -> llvm-15.0.7.src.tar.xz ++++++ /work/SRC/openSUSE:Factory/llvm15/llvm-15.0.6.src.tar.xz /work/SRC/openSUSE:Factory/.llvm15.new.32243/llvm-15.0.7.src.tar.xz differ: char 13, line 1 ++++++ llvm-do-not-install-static-libraries.patch ++++++ --- /var/tmp/diff_new_pack.GW6u2s/_old 2023-01-21 19:10:05.800796824 +0100 +++ /var/tmp/diff_new_pack.GW6u2s/_new 2023-01-21 19:10:05.804796846 +0100 @@ -2,10 +2,10 @@ want after installation. By not copying them in the first place we reduce the disk usage during installation. -Index: clang-15.0.6.src/cmake/modules/AddClang.cmake +Index: clang-15.0.7.src/cmake/modules/AddClang.cmake =================================================================== ---- a/clang-15.0.6.src/cmake/modules/AddClang.cmake -+++ b/clang-15.0.6.src/cmake/modules/AddClang.cmake +--- a/clang-15.0.7.src/cmake/modules/AddClang.cmake ++++ b/clang-15.0.7.src/cmake/modules/AddClang.cmake @@ -106,12 +106,15 @@ macro(add_clang_library name) if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ARG_INSTALL_WITH_TOOLCHAIN) @@ -68,10 +68,10 @@ endif() if (ARG_MODULE) set_target_properties(${name} PROPERTIES FOLDER "Loadable modules") -Index: lld-15.0.6.src/cmake/modules/AddLLD.cmake +Index: lld-15.0.7.src/cmake/modules/AddLLD.cmake =================================================================== ---- a/lld-15.0.6.src/cmake/modules/AddLLD.cmake -+++ b/lld-15.0.6.src/cmake/modules/AddLLD.cmake +--- a/lld-15.0.7.src/cmake/modules/AddLLD.cmake ++++ b/lld-15.0.7.src/cmake/modules/AddLLD.cmake @@ -17,13 +17,6 @@ macro(add_lld_library name) if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) @@ -86,10 +86,10 @@ if (${ARG_SHARED} AND NOT CMAKE_CONFIGURATION_TYPES) add_llvm_install_targets(install-${name} DEPENDS ${name} -Index: polly-15.0.6.src/cmake/polly_macros.cmake +Index: polly-15.0.7.src/cmake/polly_macros.cmake =================================================================== ---- a/polly-15.0.6.src/cmake/polly_macros.cmake -+++ b/polly-15.0.6.src/cmake/polly_macros.cmake +--- a/polly-15.0.7.src/cmake/polly_macros.cmake ++++ b/polly-15.0.7.src/cmake/polly_macros.cmake @@ -42,12 +42,14 @@ macro(add_polly_library name) llvm_config(${name} ${LLVM_LINK_COMPONENTS}) endif( LLVM_LINK_COMPONENTS ) @@ -110,10 +110,10 @@ endmacro(add_polly_library) macro(add_polly_loadable_module name) -Index: polly-15.0.6.src/lib/CMakeLists.txt +Index: polly-15.0.7.src/lib/CMakeLists.txt =================================================================== ---- a/polly-15.0.6.src/lib/CMakeLists.txt -+++ b/polly-15.0.6.src/lib/CMakeLists.txt +--- a/polly-15.0.7.src/lib/CMakeLists.txt ++++ b/polly-15.0.7.src/lib/CMakeLists.txt @@ -74,7 +74,7 @@ set_target_properties(PollyCore PROPERTI # It depends on all library it needs, such that with # LLVM_POLLY_LINK_INTO_TOOLS=ON, its dependencies like PollyISL are linked as ++++++ llvm-docs-15.0.6.src.tar.xz -> llvm-docs-15.0.7.src.tar.xz ++++++ /work/SRC/openSUSE:Factory/llvm15/llvm-docs-15.0.6.src.tar.xz /work/SRC/openSUSE:Factory/.llvm15.new.32243/llvm-docs-15.0.7.src.tar.xz differ: char 27, line 1 ++++++ llvm-workaround-superfluous-branches.patch ++++++ diff --git a/llvm/include/llvm/Support/Casting.h b/llvm/include/llvm/Support/Casting.h index b6bbff8..1b68640 100644 --- a/llvm/include/llvm/Support/Casting.h +++ b/llvm/include/llvm/Support/Casting.h @@ -605,6 +605,9 @@ LLVM_NODISCARD inline decltype(auto) dyn_cast(From &Val) { template <typename To, typename From> LLVM_NODISCARD inline decltype(auto) dyn_cast(From *Val) { +#if defined(__clang__) && defined(NDEBUG) + __builtin_assume(Val); +#endif return CastInfo<To, From *>::doCastIfPossible(Val); } ++++++ openmp-15.0.6.src.tar.xz -> openmp-15.0.7.src.tar.xz ++++++ ++++++ polly-15.0.6.src.tar.xz -> polly-15.0.7.src.tar.xz ++++++ /work/SRC/openSUSE:Factory/llvm15/polly-15.0.6.src.tar.xz /work/SRC/openSUSE:Factory/.llvm15.new.32243/polly-15.0.7.src.tar.xz differ: char 13, line 1