compiler is the same, but the instructions in the executable may
differ from instructions in the assembler code.
+Relaxing must be turned on if linker stubs are needed, see the
+section on @code{EIND} and linker stubs below.
+
@item -mshort-calls
@opindex mshort-calls
Use @code{RCALL}/@code{RJMP} instructions even on devices with
have the @code{CALL} and @code{JMP} instructions.
See also the @code{-mrelax} command line option.
+@item -msp8
+@opindex msp8
+Treat the stack pointer register as an 8-bit register,
+i.e.@: assume the high byte of the stack pointer is zero.
+In general, you don't need to set this option by hand.
+
+This option is used internally by the compiler to select and
+build multilibs for architectures @code{avr2} and @code{avr25}.
+These architectures mix devices with and without @code{SPH}.
+For any setting other than @code{-mmcu=avr2} or @code{-mmcu=avr25}
+the compiler driver will add or remove this option from the compiler
+proper's command line, because the compiler then knows if the device
+or architecture has an 8-bit stack pointer and thus no @code{SPH}
+register or not.
+
@item -mstrict-X
@opindex mstrict-X
Use address register @code{X} in a way proposed by the hardware. This means
@emph{trampolines}. Thus, the indirect call/jump jumps to such a stub.
The stub contains a direct jump to the desired address.
+@item
+Linker relaxation must be turned on so that the linker will generate
+the stubs correctly an all situaltion. See the compiler option
+@code{-mrelax} and the linler option @code{--relax}.
+There are corner cases where the linker is supposed to generate stubs
+but aborts without relaxation and without a helpful error message.
+
@item
The default linker script is arranged for code with @code{EIND = 0}.
If code is supposed to work for a setup with @code{EIND != 0}, a custom
__attribute__((section(".init3"),naked,used,no_instrument_function))
init3_set_eind (void)
@{
- __asm volatile ("ldi r24,pm_hh8(__trampolines_start)\n\t"
- "out %i0,r24" :: "n" (&EIND) : "r24","memory");
+ __asm volatile ("ldi r24,pm_hh8(__trampolines_start)\n\t"
+ "out %i0,r24" :: "n" (&EIND) : "r24","memory");
@}
@end example
register-register moves.
@item __AVR_HAVE_LPMX__
-The device has the @code{LPM R@var{n},Z} and @code{LPM
-R@var{n},Z+} instructions.
+The device has the @code{LPM R@var{n},Z} and
+@code{LPM R@var{n},Z+} instructions.
@item __AVR_HAVE_MUL__
The device has a hardware multiplier.
@item __AVR_HAVE_8BIT_SP__
@item __AVR_HAVE_16BIT_SP__
-The stack pointer (SP) is respectively 8 or 16 bits wide.
+The stack pointer (SP) register is treated as 8-bit respectively
+16-bit register by the compiler.
The definition of these macros is affected by @code{-mtiny-stack}.
+@item __AVR_HAVE_SPH__
+@item __AVR_SP8__
+The device has the SPH (high part of stack pointer) special function
+register or has an 8-bit stack pointer, respectively.
+The definition of these macros is affected by @code{-mmcu=} and
+in the cases of @code{-mmcu=avr2} and @code{-mmcu=avr25} also
+by @code{-msp8}.
+
@item __AVR_HAVE_RAMPD__
@item __AVR_HAVE_RAMPX__
@item __AVR_HAVE_RAMPY__