From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id EDB343858C66; Mon, 23 Jan 2023 14:15:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EDB343858C66 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1674483328; bh=sVPbeODH41AmKeXncSvpNd9L38WYiUlfa9WFDu1KMlA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=XuqMk0ATtKWPti4FORNadGZLpwIEtwVrpjxNADN9YCQXWZTrgIxmrl4+Z9C5tJmaC lKcn0zJi4Pzi5WN+aGAQ4RI6oB/3FiiJqj46gHXucZswRtFf5rIc6GpFgS9RJ6kPNr TlC1mcJ/YgIc+dd5mvF3NfdUcggzBrLtLfdzbjzU= From: "mark at kernel dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/88345] -Os overrides -falign-functions=N on the command line Date: Mon, 23 Jan 2023 14:15:25 +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: 9.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: mark at kernel dot org X-Bugzilla-Status: NEW 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=3D88345 --- Comment #14 from Mark Rutland --- > Patch posted before, but seems like not everybody agree: > https://gcc.gnu.org/pipermail/gcc-patches/2022-October/603049.html FWIW, from the arm64 kernel side all we need is a reliable mechanism to ali= gn functions, so the `-malign-all-function` or `-falign-all-functions` options= Jan suggests there would be good enough going forwards. It's just unfortunate t= hat we don't currently have a reliable mechanism (and have to workaround that by avoiding the use of `-Os` and the `__cold__` attribute), and I guess the new option would not be back-ported to stable GCC releases. I don't think we want this hidden behind a `-flive-patching` option, since = may also want the alignment when not live-patching (e.g. for our DEBUG_FORCE_FUNCTION_ALIGN_64B option), and the arch-specific details vary quite drastically (e.g. arm64 uses `-fpatchable-function-entry=3DM,N`, x86 = uses `-mfentry` for patching and `-fpatchable-function-entry` for some CFI-relat= ed logic), and those details are liable to change over time. Being able to set= the alignment independent from those details is likely to be more future-proof. If it's intended that '-falign-functions=3DN' is overridden in some cases, = it would be nice to have that more clearly documented.=