Questions about optimisation options

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello.

I'm compiling C software for an embedded ARM system with -mcpu=cortex-a8
Currently my build system uses GCC version 12.2.1.

I've been investigating the effects of -falign-functions=n:m
"Align the start of functions to the next power-of-two greater than or equal
to n, skipping up to m-1 bytes."

I've set n=64 and I'm trying different values for m...
-falign-functions=64:5
-falign-functions=64:6
-falign-functions=64:7
-falign-functions=64:8
etc.

m=5,6,7,8 all give similar output. The same for m=9,10,11,12. This is what I'd
expect since all ARM32 instructions are 4 bytes long, so would be aligned at a
minimum on 4-byte boundaries.

However I'm confused by m=1,2,3,4. m=1 gives a very different result to 2,3,4
(and in my case performance is considerably worse for m=1). What is
-falign-functions=64:1 doing here?

Also, what does it even mean when m=2, 3 or 4? If instructions are 4 bytes long,
then I thought this wouldn't actually be doing any alignment. But it gives a
different result to specifying -fno-align-functions, so presumably there is
something I'm misunderstanding?

Thanks in advance for your help,
Tim



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux