This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: alignment


On Sat, Jul 15, 2000 at 10:51:43PM +1000, Andrew Morton wrote:
> On x86, both gcc 2.7.2.3 and "2.96 19991116" are inserting `.align 4'
> ops after `jmp' instructions and also prior to `__asm__ __volatile__'.

Eh?  Alignments before an asm?  I don't believe you.  The
alignment is surely associated with a nearby label.

> Why does the compiler do this, and what would be the downside of
> turning it off?

Because modern x86 instruction decoding is sensitive to alignment.
The only downside to turning it off is potential code slowdown.
See -malign-loops= and -malign-jumps= and -malign-functions=.

We should have also tied these to -Os, but I see that we havn't.
I'll fix that shortly.


r~

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]