gcc: Size of an asm

1 
1 6.45.6 Size of an 'asm'
1 -----------------------
1 
1 Some targets require that GCC track the size of each instruction used in
1 order to generate correct code.  Because the final length of the code
1 produced by an 'asm' statement is only known by the assembler, GCC must
1 make an estimate as to how big it will be.  It does this by counting the
1 number of instructions in the pattern of the 'asm' and multiplying that
1 by the length of the longest instruction supported by that processor.
1 (When working out the number of instructions, it assumes that any
1 occurrence of a newline or of whatever statement separator character is
1 supported by the assembler -- typically ';' -- indicates the end of an
1 instruction.)
1 
1  Normally, GCC's estimate is adequate to ensure that correct code is
1 generated, but it is possible to confuse the compiler if you use pseudo
1 instructions or assembler macros that expand into multiple real
1 instructions, or if you use assembler directives that expand to more
1 space in the object file than is needed for a single instruction.  If
1 this happens then the assembler may produce a diagnostic saying that a
1 label is unreachable.
1 
1  This size is also used for inlining decisions.  If you use 'asm inline'
1 instead of just 'asm', then for inlining purposes the size of the asm is
1 taken as the minimum size, ignoring how many instructions GCC thinks it
1 is.
1