public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "mark at kernel dot org" <gcc-bugzilla@gcc.gnu.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	[thread overview]
Message-ID: <bug-88345-4-BmIlLH2Vbo@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-88345-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #11 from Mark Rutland <mark at kernel dot org> ---
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 
void abort(void)
{
        __builtin_trap();
}
[mark@lakrids:/mnt/data/tests/gcc-alignment]% usekorg 12.1.0 aarch64-linux-gcc
-falign-functions=16 -c abort.c -O2
[mark@lakrids:/mnt/data/tests/gcc-alignment]% usekorg 12.1.0
aarch64-linux-objdump -d abort.o                     

abort.o:     file format elf64-littleaarch64


Disassembly of section .text.unlikely:

0000000000000000 <abort>:
   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  Algn
  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 
2**0
                  CONTENTS, READONLY
  6 .eh_frame     00000028  0000000000000000  0000000000000000  00000058  2**3
                  CONTENTS, ALLOC, LOAD, RELOC, READONLY, DATA

  parent reply	other threads:[~2023-01-13 12:56 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-88345-4@http.gcc.gnu.org/bugzilla/>
2020-09-11 10:52 ` koen.zandberg at inria dot fr
2022-09-01  7:24 ` kito at gcc dot gnu.org
2023-01-12 11:34 ` mark at kernel dot org
2023-01-12 16:11 ` egallager at gcc dot gnu.org
2023-01-13 12:56 ` mark at kernel dot org [this message]
2023-01-17 16:26 ` ktkachov at gcc dot gnu.org
2023-01-17 16:37 ` kito at gcc dot gnu.org
2023-01-23 14:15 ` mark at kernel dot org
2023-09-12 11:47 ` rguenth at gcc dot gnu.org
2023-09-12 12:35 ` matz at gcc dot gnu.org
2023-11-22 13:20 ` hubicka at gcc dot gnu.org
2023-12-06  9:38 ` hubicka at gcc dot gnu.org
2023-12-06 13:38 ` matz at gcc dot gnu.org
2023-12-06 17:20 ` hubicka at ucw dot cz
2023-12-06 18:02 ` matz at gcc dot gnu.org
2023-12-07 10:49 ` jamborm at gcc dot gnu.org
2024-01-01 20:22 ` hubicka at gcc dot gnu.org
2024-01-24 17:13 ` cvs-commit at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-88345-4-BmIlLH2Vbo@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).