From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D52F83861845; Thu, 15 Jul 2021 07:37:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D52F83861845 From: "ashimida at linux dot alibaba.com" To: gcc-bugs@gcc.gnu.org Subject: [Bug other/101459] Mismatch in description of option "-falign-functions" between source code and documentation Date: Thu, 15 Jul 2021 07:37:10 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: other X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: documentation X-Bugzilla-Severity: normal X-Bugzilla-Who: ashimida at linux dot alibaba.com X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: WORKSFORME 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, 15 Jul 2021 07:37:11 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101459 --- Comment #3 from ashimida --- (In reply to Richard Biener from comment #2) > The flag, -falign-functions is only enabled at -O2+ (but not -Os), but the > actual alignment is recorded in the 'align_functions' data which is only > populated when -falign-functions is specified so I think it works as > documented. I tested this option in gcc 7.5.0 and 9.2.0, with the source code: int func1(void)=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 { return 0; } int func2(void) { return 0; } int main (void) { return 1; } and the result is like: ashimida@ubuntu:~/test1$ aarch64-linux-gnu-gcc -falign-functions=3D128 -O0 = test.c -o test ashimida@ubuntu:~/test1$ readelf -s test|grep fun 63: 0000000000000780 8 FUNC GLOBAL DEFAULT 13 func1 78: 0000000000000800 8 FUNC GLOBAL DEFAULT 13 func2 ashimida@ubuntu:~/test1$ aarch64-linux-gnu-gcc -O0 test.c -o test ashimida@ubuntu:~/test1$ readelf -s test|grep fun 63: 00000000000006e4 8 FUNC GLOBAL DEFAULT 13 func1 78: 00000000000006ec 8 FUNC GLOBAL DEFAULT 13 func2 so I think this flag is also worked at -O0=