[Bug libstdc++/90436] Redundant size checking in vector

2024-12-19 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90436 Jan Hubicka changed: What|Removed |Added Resolution|--- |FIXED Status|UNCONFIRMED

[Bug libstdc++/90436] Redundant size checking in vector

2020-06-21 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90436 --- Comment #4 from Marc Glisse --- (side note not related to the redundant size checking) It is surprising how, in the code from comment 2, adding v.reserve(1000) does not help, it even slows the program down slightly here (yes, that's rather ha

[Bug libstdc++/90436] Redundant size checking in vector

2020-06-21 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90436 --- Comment #3 from Marc Glisse --- // possibly assumes that ptrdiff_t and size_t have the same size size_type _M_check_len_one(const char* __str) const { ptrdiff_t __n = sizeof(_Tp); ptrdiff_t __ms = max_s

[Bug libstdc++/90436] Redundant size checking in vector

2020-06-19 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90436 --- Comment #2 from Marc Glisse --- (writing down some notes) Calling size_type _M_check_len_one(const char* __s) const { if (max_size() - size() < 1) __throw_length_error(__N(__s)); const size_type

[Bug libstdc++/90436] Redundant size checking in vector

2019-05-12 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90436 --- Comment #1 from Marc Glisse --- Adding if(size()>max_size())__builtin_unreachable()) sometimes helps, depending where you add it and in what exact form.