From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 99DE73858D20; Tue, 1 Nov 2022 21:53:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 99DE73858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1667339621; bh=/p8Plu554cQ1oZQMn/sxiRC1PiAQ31+5YcCBHahYlqw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=EN+qGPc6EVZEYxiZxuAnVG4F3DI3UcGkBdGvnV8UEZGMRTPHjOoKYWvSFwEnZ04gv 1V0bEZPeoMaA/FhI5K1e8VBYzxZHCQIdlosAYuTEA+zQ0VL/ZHUjOa2z9jwPQzzQr0 S/kDwwyNKzSxBAHP+UBoNa8REY5SiKv1qxPkOtzM= From: "glaubitz at physik dot fu-berlin.de" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/107498] Wrong optimization leads to unaligned access when compiling OpenLDAP Date: Tue, 01 Nov 2022 21:53:29 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 12.2.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: glaubitz at physik dot fu-berlin.de X-Bugzilla-Status: WAITING X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107498 --- Comment #6 from John Paul Adrian Glaubitz --- (In reply to Eric Botcazou from comment #5) > Note that the fields are marked volatile in the source: >=20 > union { > struct { > volatile indx_t pb_lower; > volatile indx_t pb_upper; > } pb; > uint32_t pb_pages; > } mp_pb; My bad. I actually modified the source to see whether marking them "volatil= e" would alleviate the issue as suggested by Howard in the OpenLDAP bug report. I'll attach the preprocessed source again, this time from the unmodified =C2=BBmdb.c=C2=AB.=