public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/107498] New: Wrong optimization leads to unaligned access when compiling OpenLDAP
@ 2022-11-01 16:54 glaubitz at physik dot fu-berlin.de
  2022-11-01 16:57 ` [Bug middle-end/107498] " pinskia at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: glaubitz at physik dot fu-berlin.de @ 2022-11-01 16:54 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 107498
           Summary: Wrong optimization leads to unaligned access when
                    compiling OpenLDAP
           Product: gcc
           Version: 12.2.0
               URL: https://bugs.openldap.org/show_bug.cgi?id=9916
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: glaubitz at physik dot fu-berlin.de
                CC: ebotcazou at gcc dot gnu.org, jrtc27 at jrtc27 dot com,
                    matorola at gmail dot com, slyfox at gcc dot gnu.org
  Target Milestone: ---
            Target: sparc64-*-*

Building OpenLDAP on sparc64-linux-gnu using gcc-12 results in a slapd binary
that crashes with unaligned access ("Bus error").

After investigation, it turned out that this is not a bug in the OpenLDAP code
but gcc-12 which tries to optimize a access to two 2-byte fields in a struct
using a 4-byte store instruction. This fails because the 2-byte fields have
only 2-byte alignment.

More details on the issue can be obtained from the corresponding OpenLDAP bug
report, in particular comment #10 [1].

> [1] https://bugs.openldap.org/show_bug.cgi?id=9916#c10

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

end of thread, other threads:[~2022-11-13 10:56 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-01 16:54 [Bug c/107498] New: Wrong optimization leads to unaligned access when compiling OpenLDAP glaubitz at physik dot fu-berlin.de
2022-11-01 16:57 ` [Bug middle-end/107498] " pinskia at gcc dot gnu.org
2022-11-01 17:04 ` jrtc27 at jrtc27 dot com
2022-11-01 17:08 ` glaubitz at physik dot fu-berlin.de
2022-11-01 17:18 ` pinskia at gcc dot gnu.org
2022-11-01 20:23 ` ebotcazou at gcc dot gnu.org
2022-11-01 21:53 ` glaubitz at physik dot fu-berlin.de
2022-11-01 21:55 ` glaubitz at physik dot fu-berlin.de
2022-11-12 10:14 ` glaubitz at physik dot fu-berlin.de
2022-11-13 10:14 ` ebotcazou at gcc dot gnu.org
2022-11-13 10:33 ` glaubitz at physik dot fu-berlin.de
2022-11-13 10:56 ` ebotcazou 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).