From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 66107385B515; Fri, 13 Jan 2023 12:56:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 66107385B515 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1673614580; bh=EHgcHREavypbWNaNzCjmhpwEz8xrXElkf0UoZdY5vsU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=fxGlhGrPVrvZCdzc+J1Up6mr/H2YCQn/8URqWdCfgF+z1GpJFaD34DmSr5negqt6v BBbPNbUFJm2ZGa1u8tFkCHN4OmJ7k3E0PavXloSvCO67ul9fV6guQyKOU4VedGcU21 zBw8Bbu/T6BPJE4Ey5naOWO6/Dcs18w0/fhWw2aE= 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: Fri, 13 Jan 2023 12:56:17 +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: UNCONFIRMED 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 #11 from Mark Rutland --- Further, at `-O1` and above GCC seems to silently drop the alignment of any implementation of abort(), apparently implicitly marking it as cold. I assume that may be true for other special functions. For example: [mark@lakrids:/mnt/data/tests/gcc-alignment]% cat abort.c=20 void abort(void) { __builtin_trap(); } [mark@lakrids:/mnt/data/tests/gcc-alignment]% usekorg 12.1.0 aarch64-linux-= gcc -falign-functions=3D16 -c abort.c -O2 [mark@lakrids:/mnt/data/tests/gcc-alignment]% usekorg 12.1.0 aarch64-linux-objdump -d abort.o=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20 abort.o: file format elf64-littleaarch64 Disassembly of section .text.unlikely: 0000000000000000 : 0: d4207d00 brk #0x3e8 [mark@lakrids:/mnt/data/tests/gcc-alignment]% usekorg 12.1.0 aarch64-linux-objdump -h abort.o abort.o: file format elf64-littleaarch64 Sections: Idx Name Size VMA LMA File off A= lgn 0 .text 00000000 0000000000000000 0000000000000000 00000040 2= **0 CONTENTS, ALLOC, LOAD, READONLY, CODE 1 .data 00000000 0000000000000000 0000000000000000 00000040 2= **0 CONTENTS, ALLOC, LOAD, DATA 2 .bss 00000000 0000000000000000 0000000000000000 00000040 2= **0 ALLOC 3 .text.unlikely 00000004 0000000000000000 0000000000000000 00000040 = 2**2 CONTENTS, ALLOC, LOAD, READONLY, CODE 4 .comment 00000013 0000000000000000 0000000000000000 00000044 2= **0 CONTENTS, READONLY 5 .note.GNU-stack 00000000 0000000000000000 0000000000000000 00000057= =20 2**0 CONTENTS, READONLY 6 .eh_frame 00000028 0000000000000000 0000000000000000 00000058 2= **3 CONTENTS, ALLOC, LOAD, RELOC, READONLY, DATA=