public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/97595] New: [11 Regression] warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=] Date: Tue, 27 Oct 2020 15:22:06 +0000 [thread overview] Message-ID: <bug-97595-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97595 Bug ID: 97595 Summary: [11 Regression] warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=] Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: redi at gcc dot gnu.org CC: msebor at gcc dot gnu.org Target Milestone: --- This code (reduced from the libstdc++) produces spurious -Wstringop-overflow diagnostics since r11-3827 when compiled with -Wsystem-headers: #include <iostream> template class std::basic_iostream<char>; In file included from /usr/include/c++/10/bits/nested_exception.h:40, from /usr/include/c++/10/exception:148, from /usr/include/c++/10/ios:39, from /usr/include/c++/10/ostream:38, from /usr/include/c++/10/iostream:39, from inst.cc:1: In member function ‘void std::basic_ios<_CharT, _Traits>::swap(std::basic_ios<_CharT, _Traits>&) [with _CharT = char; _Traits = std::char_traits<char>]’, inlined from ‘void std::basic_istream<_CharT, _Traits>::swap(std::basic_istream<_CharT, _Traits>&) [with _CharT = char; _Traits = std::char_traits<char>]’ at /usr/include/c++/10/istream:634:18, inlined from ‘void std::basic_iostream<_CharT, _Traits>::swap(std::basic_iostream<_CharT, _Traits>&) [with _CharT = char; _Traits = std::char_traits<char>]’ at /usr/include/c++/10/istream:882:29, inlined from ‘std::basic_iostream<_CharT, _Traits>& std::basic_iostream<_CharT, _Traits>::operator=(std::basic_iostream<_CharT, _Traits>&&) [with _CharT = char; _Traits = std::char_traits<char>]’ at /usr/include/c++/10/istream:876:6: /usr/include/c++/10/bits/move.h:198:11: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=] In file included from /usr/include/c++/10/iostream:40, from inst.cc:1: /usr/include/c++/10/istream: In member function ‘std::basic_iostream<_CharT, _Traits>& std::basic_iostream<_CharT, _Traits>::operator=(std::basic_iostream<_CharT, _Traits>&&) [with _CharT = char; _Traits = std::char_traits<char>]’: /usr/include/c++/10/istream:824:11: note: at offset 224 to object ‘std::basic_iostream<char>::<anonymous>’ with size 16 declared here In file included from /usr/include/c++/10/bits/nested_exception.h:40, from /usr/include/c++/10/exception:148, from /usr/include/c++/10/ios:39, from /usr/include/c++/10/ostream:38, from /usr/include/c++/10/iostream:39, from inst.cc:1: In member function ‘void std::basic_ios<_CharT, _Traits>::swap(std::basic_ios<_CharT, _Traits>&) [with _CharT = char; _Traits = std::char_traits<char>]’, inlined from ‘void std::basic_istream<_CharT, _Traits>::swap(std::basic_istream<_CharT, _Traits>&) [with _CharT = char; _Traits = std::char_traits<char>]’ at /usr/include/c++/10/istream:634:18, inlined from ‘void std::basic_iostream<_CharT, _Traits>::swap(std::basic_iostream<_CharT, _Traits>&) [with _CharT = char; _Traits = std::char_traits<char>]’ at /usr/include/c++/10/istream:882:29, inlined from ‘std::basic_iostream<_CharT, _Traits>& std::basic_iostream<_CharT, _Traits>::operator=(std::basic_iostream<_CharT, _Traits>&&) [with _CharT = char; _Traits = std::char_traits<char>]’ at /usr/include/c++/10/istream:876:6: /usr/include/c++/10/bits/move.h:199:11: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=] In file included from /usr/include/c++/10/iostream:40, from inst.cc:1: /usr/include/c++/10/istream: In member function ‘std::basic_iostream<_CharT, _Traits>& std::basic_iostream<_CharT, _Traits>::operator=(std::basic_iostream<_CharT, _Traits>&&) [with _CharT = char; _Traits = std::char_traits<char>]’: /usr/include/c++/10/istream:824:11: note: at offset 224 to object ‘std::basic_iostream<char>::<anonymous>’ with size 16 declared here In file included from /usr/include/c++/10/bits/nested_exception.h:40, from /usr/include/c++/10/exception:148, from /usr/include/c++/10/ios:39, from /usr/include/c++/10/ostream:38, from /usr/include/c++/10/iostream:39, from inst.cc:1: In member function ‘void std::basic_ios<_CharT, _Traits>::swap(std::basic_ios<_CharT, _Traits>&) [with _CharT = char; _Traits = std::char_traits<char>]’, inlined from ‘void std::basic_istream<_CharT, _Traits>::swap(std::basic_istream<_CharT, _Traits>&) [with _CharT = char; _Traits = std::char_traits<char>]’ at /usr/include/c++/10/istream:634:18, inlined from ‘void std::basic_iostream<_CharT, _Traits>::swap(std::basic_iostream<_CharT, _Traits>&) [with _CharT = char; _Traits = std::char_traits<char>]’ at /usr/include/c++/10/istream:882:29: /usr/include/c++/10/bits/move.h:198:11: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=] In file included from /usr/include/c++/10/iostream:40, from inst.cc:1: /usr/include/c++/10/istream: In member function ‘void std::basic_iostream<_CharT, _Traits>::swap(std::basic_iostream<_CharT, _Traits>&) [with _CharT = char; _Traits = std::char_traits<char>]’: /usr/include/c++/10/istream:824:11: note: at offset 224 to object ‘std::basic_iostream<char>::<anonymous>’ with size 16 declared here In file included from /usr/include/c++/10/bits/nested_exception.h:40, from /usr/include/c++/10/exception:148, from /usr/include/c++/10/ios:39, from /usr/include/c++/10/ostream:38, from /usr/include/c++/10/iostream:39, from inst.cc:1: In member function ‘void std::basic_ios<_CharT, _Traits>::swap(std::basic_ios<_CharT, _Traits>&) [with _CharT = char; _Traits = std::char_traits<char>]’, inlined from ‘void std::basic_istream<_CharT, _Traits>::swap(std::basic_istream<_CharT, _Traits>&) [with _CharT = char; _Traits = std::char_traits<char>]’ at /usr/include/c++/10/istream:634:18, inlined from ‘void std::basic_iostream<_CharT, _Traits>::swap(std::basic_iostream<_CharT, _Traits>&) [with _CharT = char; _Traits = std::char_traits<char>]’ at /usr/include/c++/10/istream:882:29: /usr/include/c++/10/bits/move.h:199:11: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=] In file included from /usr/include/c++/10/iostream:40, from inst.cc:1: /usr/include/c++/10/istream: In member function ‘void std::basic_iostream<_CharT, _Traits>::swap(std::basic_iostream<_CharT, _Traits>&) [with _CharT = char; _Traits = std::char_traits<char>]’: /usr/include/c++/10/istream:824:11: note: at offset 224 to object ‘std::basic_iostream<char>::<anonymous>’ with size 16 declared here
next reply other threads:[~2020-10-27 15:22 UTC|newest] Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-10-27 15:22 redi at gcc dot gnu.org [this message] 2020-10-27 15:22 ` [Bug tree-optimization/97595] " redi at gcc dot gnu.org 2020-10-27 15:27 ` redi at gcc dot gnu.org 2020-10-27 16:28 ` [Bug tree-optimization/97595] [11 Regression] bogus -Wstringop-overflow due to DECL_SIZE_UNIT underreporting field size msebor at gcc dot gnu.org 2020-10-28 9:09 ` rguenth at gcc dot gnu.org 2020-11-14 22:19 ` msebor at gcc dot gnu.org 2020-11-16 17:10 ` jason at gcc dot gnu.org 2020-12-01 16:16 ` msebor at gcc dot gnu.org 2020-12-01 22:11 ` cvs-commit at gcc dot gnu.org 2020-12-01 22:13 ` msebor at gcc dot gnu.org 2021-02-23 23:12 ` msebor at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-97595-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).