From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 529943858436; Thu, 2 Sep 2021 09:41:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 529943858436 From: "deller at gmx dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/102162] Byte-wise access optimized away at -O1 and above Date: Thu, 02 Sep 2021 09:41:12 +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: unknown X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: deller at gmx dot de X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: DUPLICATE 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Sep 2021 09:41:12 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102162 --- Comment #28 from deller at gmx dot de --- Arnd, there are various calls to the get_unaligned_X() functions in all kernel bootloaders, specifically in the kernel decompression routines:=20 [deller@ls3530 linux-2.6]$ grep get_unaligned lib/decompress* lib/decompress_unlz4.c: size_t out_len =3D get_unaligned_le32(input + in_le= n); lib/decompress_unlz4.c: chunksize =3D get_unaligned_le32(inp); lib/decompress_unlz4.c: chunksize =3D get_unaligned_le32(inp); lib/decompress_unlzo.c: version =3D get_unaligned_be16(parse); lib/decompress_unlzo.c: if (get_unaligned_be32(parse) & HEADER_HAS_FILTER) lib/decompress_unlzo.c: dst_len =3D get_unaligned_be32(in_buf); lib/decompress_unlzo.c: src_len =3D get_unaligned_be32(in_buf); So sadly it's not possible to work around that cases with linker scripts, because they work on externally generated compressed files (kernel code) for which the specs of the compressed files can't be changed. Same for the output_len variable - externally linked in directly behind the code and not (easily?) changeable. Helge=