public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/106297] New: stringop-overflow misbehaviour on atomic
@ 2022-07-14 14:05 chipitsine at gmail dot com
  2022-07-14 16:05 ` [Bug tree-optimization/106297] " pinskia at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: chipitsine at gmail dot com @ 2022-07-14 14:05 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 106297
           Summary: stringop-overflow misbehaviour on atomic
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: chipitsine at gmail dot com
  Target Milestone: ---

repro steps

git clone https://github.com/haproxy/haproxy
cd haproxy

export CC=/path/to/gcc
make CC=$CC ERR=1 TARGET=linux-glibc 

error reported:

src/haproxy.c: In function ‘run_poll_loop’:
include/haproxy/atomic.h:428:39: error: ‘__atomic_load_8’ writing 8 bytes into
a region of size 0 overflows the destination [-Werror=stringop-overflow=]
  428 | #define _HA_ATOMIC_LOAD(val)          __atomic_load_n(val,
__ATOMIC_RELAXED)
      |                                      
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/haproxy.c:2843:46: note: in expansion of macro ‘_HA_ATOMIC_LOAD’
 2843 |                                         if
((_HA_ATOMIC_LOAD(&ha_tgroup_ctx[i].stopping_threads) &
ha_tgroup_info[i].threads_enabled) !=
      |                                              ^~~~~~~~~~~~~~~
compilation terminated due to -Wfatal-errors.




error was reviewed by Willy Tarreau in
https://github.com/haproxy/haproxy/issues/1767 and it is considered as false
positive.

I bisected gcc, breaking change is:
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=88b504b7a8c5affb0ffa97990d22af2b199e36ed

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

end of thread, other threads:[~2023-05-08 12:25 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-14 14:05 [Bug c/106297] New: stringop-overflow misbehaviour on atomic chipitsine at gmail dot com
2022-07-14 16:05 ` [Bug tree-optimization/106297] " pinskia at gcc dot gnu.org
2022-07-15  2:33 ` chipitsine at gmail dot com
2022-07-15  8:05 ` [Bug tree-optimization/106297] [12/13 Regression] stringop-overflow misbehaviour on atomic since r12-4725-g88b504b7a8c5affb marxin at gcc dot gnu.org
2022-07-15  8:05 ` marxin at gcc dot gnu.org
2022-07-18  7:27 ` rguenth at gcc dot gnu.org
2022-07-25 15:03 ` rguenth at gcc dot gnu.org
2022-07-28 14:33 ` jakub at gcc dot gnu.org
2022-07-28 15:28 ` msebor at gcc dot gnu.org
2023-05-08 12:25 ` [Bug tree-optimization/106297] [12/13/14 " rguenth 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).