public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/115539] New: Misoptimization of application at -O2 -g on x86-64 causing segfaults on valid memory accesses where it works on both clang and gcc at -g (no -O2)
@ 2024-06-18 11:55 melodygoad18 at gmail dot com
  2024-06-18 11:59 ` [Bug c/115539] " schwab@linux-m68k.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: melodygoad18 at gmail dot com @ 2024-06-18 11:55 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 115539
           Summary: Misoptimization of application at -O2 -g on x86-64
                    causing segfaults on valid memory accesses where it
                    works on both clang and gcc at -g (no -O2)
           Product: gcc
           Version: 14.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: melodygoad18 at gmail dot com
  Target Milestone: ---

Hi. I maintain a program that gets misoptimized at -O2 -g on gcc 14.1.1. This
wasn't happening on GCC 12 or 13 AFAIR, and it also doesn't happen on Windows.
Only on Linux. This also doesn't happen on clang with the same flags or on gcc
with simply -g. The problem is in the fastreadl_fetch function, where it
crashes on a perfectly valid memory access, but only if it's compiled with gcc
14.1.1 with -O2 -g flags on Linux. gdb is able to access the memory when it
crashes too, so it's most likely a compiler bug.

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

end of thread, other threads:[~2024-06-18 16:09 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-18 11:55 [Bug c/115539] New: Misoptimization of application at -O2 -g on x86-64 causing segfaults on valid memory accesses where it works on both clang and gcc at -g (no -O2) melodygoad18 at gmail dot com
2024-06-18 11:59 ` [Bug c/115539] " schwab@linux-m68k.org
2024-06-18 12:08 ` melodygoad18 at gmail dot com
2024-06-18 12:09 ` melodygoad18 at gmail dot com
2024-06-18 12:27 ` jakub at gcc dot gnu.org
2024-06-18 12:46 ` sjames at gcc dot gnu.org
2024-06-18 12:47 ` sjames at gcc dot gnu.org
2024-06-18 12:47 ` sjames at gcc dot gnu.org
2024-06-18 16:09 ` [Bug middle-end/115539] " pinskia 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).