public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug driver/94381] New: -falign-function/-falign-labels/-falign-loops documentation is inaccurate
@ 2020-03-28 14:11 hjl.tools at gmail dot com
  2020-03-28 14:33 ` [Bug driver/94381] " hjl.tools at gmail dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: hjl.tools at gmail dot com @ 2020-03-28 14:11 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 94381
           Summary: -falign-function/-falign-labels/-falign-loops
                    documentation is inaccurate
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: driver
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hjl.tools at gmail dot com
                CC: crazylht at gmail dot com, skpgkp2 at gmail dot com
  Target Milestone: ---

'-falign-functions'
'-falign-functions=N'
'-falign-functions=N:M'
'-falign-functions=N:M:N2'
'-falign-functions=N:M:N2:M2'
     Align the start of functions to the next power-of-two greater than
     N, skipping up to M-1 bytes.

But

[hjl@gnu-cfl-2 align]$ cat y.i
void
foo (void)
{
}
[hjl@gnu-cfl-2 align]$ gcc -O2 -S -falign-functions=4 y.i
[hjl@gnu-cfl-2 align]$ cat y.s
        .file   "y.i"
        .text
        .p2align 2 <<<<<<<< 4 is not the next power-of-two greater than 4.
        .globl  foo
        .type   foo, @function
foo:
.LFB0:
        .cfi_startproc
        ret
        .cfi_endproc
.LFE0:
        .size   foo, .-foo
        .ident  "GCC: (GNU) 9.3.1 20200317 (Red Hat 9.3.1-1)"
        .section        .note.GNU-stack,"",@progbits
[hjl@gnu-cfl-2 align]$ 

It should be "the next power-of-two no less than N".

'-falign-labels'
'-falign-labels=N'
'-falign-labels=N:M'
'-falign-labels=N:M:N2'
'-falign-labels=N:M:N2:M2'
     Align all branch targets to a power-of-two boundary.

and

'-falign-loops'
'-falign-loops=N'
'-falign-loops=N:M'
'-falign-loops=N:M:N2'
'-falign-loops=N:M:N2:M2'
     Align loops to a power-of-two boundary.  

may leave an impression of alignment is N to the power-of-two.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-03-29 22:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-28 14:11 [Bug driver/94381] New: -falign-function/-falign-labels/-falign-loops documentation is inaccurate hjl.tools at gmail dot com
2020-03-28 14:33 ` [Bug driver/94381] " hjl.tools at gmail dot com
2020-03-28 21:36 ` hjl.tools at gmail dot com
2020-03-29 22:57 ` cvs-commit at gcc dot gnu.org
2020-03-29 22:58 ` hjl.tools at gmail dot com

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).