This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: alignment
- To: Andrew Morton <andrewm at uow dot edu dot au>
- Subject: Re: alignment
- From: Richard Henderson <rth at cygnus dot com>
- Date: Sat, 15 Jul 2000 16:00:25 -0700
- Cc: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- References: <39705E5F.CE00658@uow.edu.au>
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~