Next: , Previous: , Up: Function Attributes   [Contents][Index]


6.31.10 IA-16 Function Attributes

These function attributes are supported by the IA-16 back end:

cdecl

On the IA-16 target, the cdecl attribute causes the compiler to assume that the calling function pops off the stack space used to pass arguments. This is useful to override the effects of a -mrtd or -mregparmcall switch.

stdcall

On the IA-16 target, the stdcall attribute causes the compiler to assume that the called function pops off the stack space used to pass arguments, unless it takes a variable number of arguments.

regparmcall

On the IA-16 target, the regparmcall attribute causes the compiler to pass its first few arguments to the function in the registers ax, dx, and cx, instead of on the stack. The called function pops the arguments off the stack.

An exception is that, if the number of arguments is variable, the ... variable arguments will always go on the stack, and the calling function pops all pushed arguments.

assume_ds_data

This attribute, attached to a function, causes the compiler to assume that the ds register points to the program’s data segment on function entry. The function will also arrange to restore ds to the same data segment on function exit.

Use this attribute to override the -mno-callee-assume-ds-data-segment switch for a function.

This attribute has no effect if ds is a call-saved register (-fcall-saved-ds).

no_assume_ds_data

This attribute, attached to a function, causes the compiler not to assume that ds points to the program’s data segment on function entry. It has no effect if ds is a call-saved register.

Note that, if ds is a call-used register (the default), this also means that the function may clobber ds—and callers cannot assume that the function will preserve it—unless you also specify the restore_ds attribute.

restore_ds

This attribute, attached to a function, means that the function should preserve the ds register value and restore it on function return. This is mostly useful in conjunction with the no_assume_ds_data attribute.

This attribute has no effect if ds is a fixed or call-saved register (-ffixed-ds or -fcall-saved-ds).

no_assume_ss_data

This attribute, attached to a function, causes the compiler not to assume that ss points to the program’s data segment on function entry. The function’s stack parameters and variables are considered to be in a separate __seg_ss address space. See IA-16 Named Address Spaces.

Warning: This feature is experimental, and may produce broken code. Use with caution.

near_section

This attribute, attached to a far function declaration, tells GCC that the function is known to reside in the program’s text segment. See IA-16 Named Address Spaces.

far_section

This attribute, attached to a far function definition, tells GCC to place the function outside the normal text segment. See IA-16 Named Address Spaces.


Next: , Previous: , Up: Function Attributes   [Contents][Index]