prev UP NEXT Using and Porting GNU CC

3.14.1: M680x0 Options

These are the `-m' options defined for the 68000 series. The default values for these options depends on which style of 68000 was selected when the compiler was configured; the defaults for the most common choices are given below.

Generate output for a 68000. This is the default when the compiler is configured for 68000-based systems.
Generate output for a 68020. This is the default when the compiler is configured for 68020-based systems.
Generate output containing 68881 instructions for floating point. This is the default for most 68020 systems unless `-nfp' was specified when the compiler was configured.
Generate output for a 68030. This is the default when the compiler is configured for 68030-based systems.
Generate output for a 68040. This is the default when the compiler is configured for 68040-based systems.

This option inhibits the use of 68881/68882 instructions that have to be emulated by software on the 68040. If your 68040 does not have code to emulate those instructions, use `-m68040'.

Generate output for a 68040, without using any of the new instructions. This results in code which can run relatively efficiently on either a 68020/68881 or a 68030 or a 68040. The generated code does use the 68881 instructions that are emulated on the 68040.
Generate output containing Sun FPA instructions for floating point.
Generate output containing library calls for floating point. Warning: the requisite libraries are not part of GNU CC. Normally the facilities of the machine's usual C compiler are used, but this can't be done directly in cross-compilation. You must make your own arrangements to provide suitable library functions for cross-compilation.
Consider type int to be 16 bits wide, like short int.
Do not use the bit-field instructions. The `-m68000' option implies `-mnobitfield'.
Do use the bit-field instructions. The `-m68020' option implies `-mbitfield'. This is the default if you use a configuration designed for a 68020.
Use a different function-calling convention, in which functions that take a fixed number of arguments return with the rtd instruction, which pops their arguments while returning. This saves one instruction in the caller since there is no need to pop the arguments there.

This calling convention is incompatible with the one normally used on Unix, so you cannot use it if you need to call libraries compiled with the Unix compiler.

Also, you must provide function prototypes for all functions that take variable numbers of arguments (including printf); otherwise incorrect code will be generated for calls to those functions.

In addition, seriously incorrect code will result if you call a function with too many arguments. (Normally, extra arguments are harmlessly ignored.)

The rtd instruction is supported by the 68010 and 68020 processors, but not by the 68000.