public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/97595] New: [11 Regression] warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
@ 2020-10-27 15:22 redi at gcc dot gnu.org
  2020-10-27 15:22 ` [Bug tree-optimization/97595] " redi at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: redi at gcc dot gnu.org @ 2020-10-27 15:22 UTC (permalink / raw)
  To: gcc-bugs

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-02-23 23:12 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-27 15:22 [Bug tree-optimization/97595] New: [11 Regression] warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=] redi at gcc dot gnu.org
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

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).