public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/102466] New: -O3 -fsanitize=undefined causes warnings  (writing 2 bytes into a region of size 0)
@ 2021-09-23  7:08 unlvsur at live dot com
  2021-09-27 14:00 ` [Bug tree-optimization/102466] " marxin at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: unlvsur at live dot com @ 2021-09-23  7:08 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102466

            Bug ID: 102466
           Summary: -O3 -fsanitize=undefined causes warnings  (writing 2
                    bytes into a region of size 0)
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: unlvsur at live dot com
  Target Milestone: ---

Created attachment 51503
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51503&action=edit
Preprocessed file

without -fsanitize=undefined or use -O2 won't trigger the warning here

cqwrteur@Home-Server:~/fast_io/examples/0021.kernel_driver$ g++ -S main.cc
-std=c++20 -I../../include  -s -fno-exceptions -fno-rtti -fsanitize=undefined
-O3 -ffreestanding
In function 'constexpr void
fast_io::linux::print_status_define(fast_io::linux::basic_kpr<ch_type>, Args
...) [with bool line = true; ch_type = char; Args =
{fast_io::basic_io_scatter_t<char>,
fast_io::manipulators::scalar_manip_t<fast_io::manipulators::scalar_flags{10,
false, false, false, false, false, false, false, true, false, false, false,
fast_io::manipulators::scalar_placement::none,
fast_io::manipulators::floating_format::fixed,
fast_io::manipulators::lc_time_flag::none}, int>,
fast_io::basic_io_scatter_t<char>, fast_io::basic_io_scatter_t<char>,
fast_io::manipulators::scalar_manip_t<fast_io::manipulators::scalar_flags{10,
false, false, false, false, false, false, false, true, false, false, false,
fast_io::manipulators::scalar_placement::none,
fast_io::manipulators::floating_format::fixed,
fast_io::manipulators::lc_time_flag::none}, int>,
fast_io::manipulators::scalar_manip_t<fast_io::manipulators::scalar_flags{10,
false, false, false, false, false, false, false, true, false, false, false,
fast_io::manipulators::scalar_placement::none,
fast_io::manipulators::floating_format::fixed,
fast_io::manipulators::lc_time_flag::none}, unsigned int>}]':
cc1plus: warning: writing 2 bytes into a region of size 0
[-Wstringop-overflow=]
cc1plus: warning: writing 2 bytes into a region of size 0
[-Wstringop-overflow=]
cc1plus: warning: writing 2 bytes into a region of size 0
[-Wstringop-overflow=]
cc1plus: warning: writing 2 bytes into a region of size 0
[-Wstringop-overflow=]
cc1plus: warning: writing 2 bytes into a region of size 0
[-Wstringop-overflow=]
cc1plus: warning: writing 2 bytes into a region of size 0
[-Wstringop-overflow=]
cc1plus: warning: writing 2 bytes into a region of size 0
[-Wstringop-overflow=]
cc1plus: warning: writing 2 bytes into a region of size 0
[-Wstringop-overflow=]
cc1plus: warning: writing 2 bytes into a region of size 0
[-Wstringop-overflow=]
cc1plus: warning: writing 2 bytes into a region of size 0
[-Wstringop-overflow=]
cc1plus: warning: writing 2 bytes into a region of size 0
[-Wstringop-overflow=]



This is freestanding code to reduce size of processor file. You can just treat
printk function as printf. -ffreestanding does not affect whether the warning
would emit or not.

Do not know whether it is a false positive.

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

end of thread, other threads:[~2022-03-29 14:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-23  7:08 [Bug c++/102466] New: -O3 -fsanitize=undefined causes warnings (writing 2 bytes into a region of size 0) unlvsur at live dot com
2021-09-27 14:00 ` [Bug tree-optimization/102466] " marxin at gcc dot gnu.org
2021-09-27 21:37 ` msebor at gcc dot gnu.org
2022-03-29 14:20 ` mathieu.malaterre at gmail dot com
2022-03-29 14:22 ` mathieu.malaterre at gmail dot com

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