[Bug middle-end/98465] Bogus warning stringop-overread wuth -std=gnu++20 -O2 and std::string::insert

2021-01-19 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98465 Martin Sebor changed: What|Removed |Added Keywords||patch --- Comment #16 from Martin Sebor

[Bug middle-end/98465] Bogus warning stringop-overread wuth -std=gnu++20 -O2 and std::string::insert

2021-01-13 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98465 Martin Sebor changed: What|Removed |Added See Also||https://gcc.gnu.org/bugzill

[Bug middle-end/98465] Bogus warning stringop-overread wuth -std=gnu++20 -O2 and std::string::insert

2021-01-13 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98465 --- Comment #14 from Martin Sebor --- Smallish test case independent of libstdc++ that reproduces both the false positive (due to the missing aliasing constraint) and its absence (due to a bug/limitation in tree_inlined_location). With

[Bug middle-end/98465] Bogus warning stringop-overread wuth -std=gnu++20 -O2 and std::string::insert

2021-01-13 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98465 --- Comment #13 from Jakub Jelinek --- Note, it is important to be able for -g0 to be able to optimize as many BLOCKs as possible especially for LTO memory consumptions, so it should be just the BLOCKs at inline boundaries that could be

[Bug middle-end/98465] Bogus warning stringop-overread wuth -std=gnu++20 -O2 and std::string::insert

2021-01-13 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98465 --- Comment #12 from Martin Sebor --- (In reply to Jeffrey A. Law from comment #10) > What about fixing the -g interaction? Much like how -g shouldn't affect > code generation, it probably shouldn't be affecting warnings like this. > > There

[Bug middle-end/98465] Bogus warning stringop-overread wuth -std=gnu++20 -O2 and std::string::insert

2021-01-13 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98465 Jakub Jelinek changed: What|Removed |Added CC||jakub at gcc dot gnu.org --- Comment

[Bug middle-end/98465] Bogus warning stringop-overread wuth -std=gnu++20 -O2 and std::string::insert

2021-01-13 Thread law at redhat dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98465 Jeffrey A. Law changed: What|Removed |Added CC||law at redhat dot com --- Comment #10

[Bug middle-end/98465] Bogus warning stringop-overread wuth -std=gnu++20 -O2 and std::string::insert

2021-01-13 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98465 Martin Sebor changed: What|Removed |Added Status|NEW |ASSIGNED Target Milestone|---

[Bug middle-end/98465] Bogus warning stringop-overread wuth -std=gnu++20 -O2 and std::string::insert

2021-01-07 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98465 Martin Sebor changed: What|Removed |Added See Also||https://gcc.gnu.org/bugzill

[Bug middle-end/98465] Bogus warning stringop-overread wuth -std=gnu++20 -O2 and std::string::insert

2021-01-06 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98465 --- Comment #7 from Martin Sebor --- Adding #pragma GCC diagnostic ignore "-Wstringop-overread" to string::_M_replace(size_type, size_type, const _CharT*, const size_type) doesn't suppress the warning, either on trunk, or (with

[Bug middle-end/98465] Bogus warning stringop-overread wuth -std=gnu++20 -O2 and std::string::insert

2021-01-06 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98465 --- Comment #6 from Martin Sebor --- Different -std= settings also affect the warning, again as a result of inlining and the explicit instantiation declarations. The basic_string.tcc file has the following block toward the end which explains

[Bug middle-end/98465] Bogus warning stringop-overread wuth -std=gnu++20 -O2 and std::string::insert

2021-01-06 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98465 --- Comment #5 from Martin Sebor --- Comparing the code emitted by GCC 10 and the current trunk shows that the former doesn't inline std::string::replace() regardless of the inlining limit. The translation unit obtained with the former shows

[Bug middle-end/98465] Bogus warning stringop-overread wuth -std=gnu++20 -O2 and std::string::insert

2020-12-30 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98465 --- Comment #4 from Martin Sebor --- (In reply to Romain Geissler from comment #2) > There seems to be a strange interaction between -Wsystem-headers and -g in > gcc 11 which I don't understand. Thanks for the -g hint; with it I can see it on

[Bug middle-end/98465] Bogus warning stringop-overread wuth -std=gnu++20 -O2 and std::string::insert

2020-12-30 Thread romain.geissler at amadeus dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98465 --- Comment #3 from Romain Geissler --- I have found another example in my code base raising this error: #include std::string f1() { std::string aString = "string"; aString = "bigger str"; return aString; } With: -O2

[Bug middle-end/98465] Bogus warning stringop-overread wuth -std=gnu++20 -O2 and std::string::insert

2020-12-30 Thread romain.geissler at amadeus dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98465 --- Comment #2 from Romain Geissler --- Hi Martin, Thanks for your investigation. I have a few questions: - Since the warning seems to be fully emitted by system headers, shouldn't it be silenced by default ? Why isn't it the case here ? On

[Bug middle-end/98465] Bogus warning stringop-overread wuth -std=gnu++20 -O2 and std::string::insert

2020-12-28 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98465 Martin Sebor changed: What|Removed |Added CC||msebor at gcc dot gnu.org