[Bug other/101459] Mismatch in description of option "-falign-functions" between source code and documentation
ashimida at linux dot alibaba.com
gcc-bugzilla@gcc.gnu.org
Thu Jul 15 07:37:10 GMT 2021
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101459
--- Comment #3 from ashimida <ashimida at linux dot alibaba.com> ---
(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)
{
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=128 -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
More information about the Gcc-bugs
mailing list