aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Earnshaw <rearnsha@arm.com>2003-10-04 10:18:33 +0000
committerRichard Earnshaw <rearnsha@gcc.gnu.org>2003-10-04 10:18:33 +0000
commitece7fc1c597318c531778033f1e1a30cf4012783 (patch)
treef5b296c92a0b9aad4a4156603a2dd8df18b78498
parent78e82bbe0b7adf406b7b55fb6af0054a57d304d4 (diff)
downloadgcc-ece7fc1c597318c531778033f1e1a30cf4012783.zip
gcc-ece7fc1c597318c531778033f1e1a30cf4012783.tar.gz
gcc-ece7fc1c597318c531778033f1e1a30cf4012783.tar.bz2
extend.texi: Document how GCC estimates and relies on the size of an asm.
* doc/extend.texi: Document how GCC estimates and relies on the size of an asm. From-SVN: r72089
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/doc/extend.texi20
2 files changed, 25 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 187375d..ebc9864 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2003-10-04 Richard Earnshaw <reanrsha@arm.com>
+
+ * doc/extend.texi: Document how GCC estimates and relies on the size
+ of an asm.
+
2003-10-04 Richard Sandiford <rsandifo@redhat.com>
* config/mips/mips.c (mips_pad_arg_upward): Pad floating-point
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index ce31713..36fbd26 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -4136,6 +4136,26 @@ If you are writing a header file that should be includable in ISO C
programs, write @code{__asm__} instead of @code{asm}. @xref{Alternate
Keywords}.
+@subsection Size of an @code{asm}
+
+Some targets require that GCC track the size of each instruction used in
+order to generate correct code. Because the final length of an
+@code{asm} is only known by the assembler, GCC must make an estimate as
+to how big it will be. The estimate is formed by counting the number of
+statements in the pattern of the @code{asm} and multiplying that by the
+length of the longest instruction on that processor. Statements in the
+@code{asm} are identified by newline characters and whatever statement
+separator characters are supported by the assembler; on most processors
+this is the `@code{;}' character.
+
+Normally, GCC's estimate is perfectly adequate to ensure that correct
+code is generated, but it is possible to confuse the compiler if you use
+pseudo instructions or assembler macros that expand into multiple real
+instructions or if you use assembler directives that expand to more
+space in the object file than would be needed for a single instruction.
+If this happens then the assembler will produce a diagnostic saying that
+a label is unreachable.
+
@subsection i386 floating point asm operands
There are several rules on the usage of stack-like regs in