// { dg-do compile { target c++11 } }
-// { dg-options "-O1 -fdump-tree-optimized" }
+// { dg-options "-O2 -fdump-tree-optimized" }
#include <vector>
#define T int
T vat1(std::vector<T> v1) {
_GLIBCXX_NODISCARD _GLIBCXX20_CONSTEXPR
size_type
size() const _GLIBCXX_NOEXCEPT
- { return size_type(this->_M_impl._M_finish - this->_M_impl._M_start); }
+ {
+ ptrdiff_t __dif = this->_M_impl._M_finish - this->_M_impl._M_start;
+ if (__dif < 0)
+ __builtin_unreachable ();
+ return size_type(__dif);
+ }
/** Returns the size() of the largest possible %vector. */
_GLIBCXX_NODISCARD _GLIBCXX20_CONSTEXPR
size_type
capacity() const _GLIBCXX_NOEXCEPT
{
- return size_type(this->_M_impl._M_end_of_storage
- - this->_M_impl._M_start);
+ ptrdiff_t __dif = this->_M_impl._M_end_of_storage
+ - this->_M_impl._M_start;
+ if (__dif < 0)
+ __builtin_unreachable ();
+ return size_type(__dif);
}
/**