|
|
1.1.1.4 ! root 1: This is Info file gcc.info, produced by Makeinfo-1.49 from the input 1.1 root 2: file gcc.texi. 3: 4: This file documents the use and the internals of the GNU compiler. 5: 6: Copyright (C) 1988, 1989, 1992 Free Software Foundation, Inc. 7: 1.1.1.3 root 8: Permission is granted to make and distribute verbatim copies of this 9: manual provided the copyright notice and this permission notice are 10: preserved on all copies. 1.1 root 11: 12: Permission is granted to copy and distribute modified versions of 13: this manual under the conditions for verbatim copying, provided also 1.1.1.4 ! root 14: that the sections entitled "GNU General Public License" and "Protect ! 15: Your Freedom--Fight `Look And Feel'" are included exactly as in the ! 16: original, and provided that the entire resulting derived work is ! 17: distributed under the terms of a permission notice identical to this ! 18: one. 1.1 root 19: 20: Permission is granted to copy and distribute translations of this 21: manual into another language, under the above conditions for modified 1.1.1.3 root 22: versions, except that the sections entitled "GNU General Public 1.1.1.4 ! root 23: License" and "Protect Your Freedom--Fight `Look And Feel'", and this ! 24: permission notice, may be included in translations approved by the Free ! 25: Software Foundation instead of in the original English. 1.1.1.3 root 26: 27: 1.1.1.4 ! root 28: File: gcc.info, Node: Register Classes, Next: Stack and Calling, Prev: Registers, Up: Target Macros 1.1.1.3 root 29: 1.1.1.4 ! root 30: Register Classes ! 31: ================ ! 32: ! 33: On many machines, the numbered registers are not all equivalent. For ! 34: example, certain registers may not be allowed for indexed addressing; ! 35: certain registers may not be allowed in some instructions. These ! 36: machine restrictions are described to the compiler using "register ! 37: classes". ! 38: ! 39: You define a number of register classes, giving each one a name and ! 40: saying which of the registers belong to it. Then you can specify ! 41: register classes that are allowed as operands to particular instruction ! 42: patterns. ! 43: ! 44: In general, each register will belong to several classes. In fact, ! 45: one class must be named `ALL_REGS' and contain all the registers. ! 46: Another class must be named `NO_REGS' and contain no registers. Often ! 47: the union of two classes will be another class; however, this is not ! 48: required. ! 49: ! 50: One of the classes must be named `GENERAL_REGS'. There is nothing ! 51: terribly special about the name, but the operand constraint letters `r' ! 52: and `g' specify this class. If `GENERAL_REGS' is the same as ! 53: `ALL_REGS', just define it as a macro which expands to `ALL_REGS'. ! 54: ! 55: Order the classes so that if class X is contained in class Y then X ! 56: has a lower class number than Y. ! 57: ! 58: The way classes other than `GENERAL_REGS' are specified in operand ! 59: constraints is through machine-dependent operand constraint letters. ! 60: You can define such letters to correspond to various classes, then use ! 61: them in operand constraints. ! 62: ! 63: You should define a class for the union of two classes whenever some ! 64: instruction allows both classes. For example, if an instruction allows ! 65: either a floating point (coprocessor) register or a general register ! 66: for a certain operand, you should define a class `FLOAT_OR_GENERAL_REGS' ! 67: which includes both of them. Otherwise you will get suboptimal code. ! 68: ! 69: You must also specify certain redundant information about the ! 70: register classes: for each class, which classes contain it and which ! 71: ones are contained in it; for each pair of classes, the largest class ! 72: contained in their union. ! 73: ! 74: When a value occupying several consecutive registers is expected in a ! 75: certain class, all the registers used must belong to that class. ! 76: Therefore, register classes cannot be used to enforce a requirement for ! 77: a register pair to start with an even-numbered register. The way to ! 78: specify this requirement is with `HARD_REGNO_MODE_OK'. ! 79: ! 80: Register classes used for input-operands of bitwise-and or shift ! 81: instructions have a special requirement: each such class must have, for ! 82: each fixed-point machine mode, a subclass whose registers can transfer ! 83: that mode to or from memory. For example, on some machines, the ! 84: operations for single-byte values (`QImode') are limited to certain ! 85: registers. When this is so, each register class that is used in a ! 86: bitwise-and or shift instruction must have a subclass consisting of ! 87: registers from which single-byte values can be loaded or stored. This ! 88: is so that `PREFERRED_RELOAD_CLASS' can always have a possible value to ! 89: return. ! 90: ! 91: `enum reg_class' ! 92: An enumeral type that must be defined with all the register class ! 93: names as enumeral values. `NO_REGS' must be first. `ALL_REGS' ! 94: must be the last register class, followed by one more enumeral ! 95: value, `LIM_REG_CLASSES', which is not a register class but rather ! 96: tells how many classes there are. ! 97: ! 98: Each register class has a number, which is the value of casting ! 99: the class name to type `int'. The number serves as an index in ! 100: many of the tables described below. ! 101: ! 102: `N_REG_CLASSES' ! 103: The number of distinct register classes, defined as follows: ! 104: ! 105: #define N_REG_CLASSES (int) LIM_REG_CLASSES ! 106: ! 107: `REG_CLASS_NAMES' ! 108: An initializer containing the names of the register classes as C ! 109: string constants. These names are used in writing some of the ! 110: debugging dumps. ! 111: ! 112: `REG_CLASS_CONTENTS' ! 113: An initializer containing the contents of the register classes, as ! 114: integers which are bit masks. The Nth integer specifies the ! 115: contents of class N. The way the integer MASK is interpreted is ! 116: that register R is in the class if `MASK & (1 << R)' is 1. ! 117: ! 118: When the machine has more than 32 registers, an integer does not ! 119: suffice. Then the integers are replaced by sub-initializers, ! 120: braced groupings containing several integers. Each ! 121: sub-initializer must be suitable as an initializer for the type ! 122: `HARD_REG_SET' which is defined in `hard-reg-set.h'. ! 123: ! 124: `REGNO_REG_CLASS (REGNO)' ! 125: A C expression whose value is a register class containing hard ! 126: register REGNO. In general there is more than one such class; ! 127: choose a class which is "minimal", meaning that no smaller class ! 128: also contains the register. ! 129: ! 130: `BASE_REG_CLASS' ! 131: A macro whose definition is the name of the class to which a valid ! 132: base register must belong. A base register is one used in an ! 133: address which is the register value plus a displacement. ! 134: ! 135: `INDEX_REG_CLASS' ! 136: A macro whose definition is the name of the class to which a valid ! 137: index register must belong. An index register is one used in an ! 138: address where its value is either multiplied by a scale factor or ! 139: added to another register (as well as added to a displacement). ! 140: ! 141: `REG_CLASS_FROM_LETTER (CHAR)' ! 142: A C expression which defines the machine-dependent operand ! 143: constraint letters for register classes. If CHAR is such a ! 144: letter, the value should be the register class corresponding to ! 145: it. Otherwise, the value should be `NO_REGS'. The register ! 146: letter `r', corresponding to class `GENERAL_REGS', will not be ! 147: passed to this macro; you do not need to handle it. ! 148: ! 149: `REGNO_OK_FOR_BASE_P (NUM)' ! 150: A C expression which is nonzero if register number NUM is suitable ! 151: for use as a base register in operand addresses. It may be either ! 152: a suitable hard register or a pseudo register that has been ! 153: allocated such a hard register. ! 154: ! 155: `REGNO_OK_FOR_INDEX_P (NUM)' ! 156: A C expression which is nonzero if register number NUM is suitable ! 157: for use as an index register in operand addresses. It may be ! 158: either a suitable hard register or a pseudo register that has been ! 159: allocated such a hard register. 1.1.1.3 root 160: 1.1.1.4 ! root 161: The difference between an index register and a base register is ! 162: that the index register may be scaled. If an address involves the ! 163: sum of two registers, neither one of them scaled, then either one ! 164: may be labeled the "base" and the other the "index"; but whichever ! 165: labeling is used must fit the machine's constraints of which ! 166: registers may serve in each capacity. The compiler will try both ! 167: labelings, looking for one that is valid, and will reload one or ! 168: both registers only if neither labeling works. 1.1.1.3 root 169: 1.1.1.4 ! root 170: `PREFERRED_RELOAD_CLASS (X, CLASS)' ! 171: A C expression that places additional restrictions on the register ! 172: class to use when it is necessary to copy value X into a register ! 173: in class CLASS. The value is a register class; perhaps CLASS, or ! 174: perhaps another, smaller class. On many machines, the definition ! 175: ! 176: #define PREFERRED_RELOAD_CLASS(X,CLASS) CLASS ! 177: ! 178: is safe. ! 179: ! 180: Sometimes returning a more restrictive class makes better code. ! 181: For example, on the 68000, when X is an integer constant that is ! 182: in range for a `moveq' instruction, the value of this macro is ! 183: always `DATA_REGS' as long as CLASS includes the data registers. ! 184: Requiring a data register guarantees that a `moveq' will be used. ! 185: ! 186: If X is a `const_double', by returning `NO_REGS' you can force X ! 187: into a memory constant. This is useful on certain machines where ! 188: immediate floating values cannot be loaded into certain kinds of ! 189: registers. 1.1.1.3 root 190: 1.1.1.4 ! root 191: `PREFERRED_OUTPUT_RELOAD_CLASS (X, CLASS)' ! 192: Like `PREFERRED_RELOAD_CLASS', but for output reloads instead of ! 193: input reloads. If you don't define this macro, the default is to ! 194: use CLASS, unchanged. ! 195: ! 196: `LIMIT_RELOAD_CLASS (MODE, CLASS)' ! 197: A C expression that places additional restrictions on the register ! 198: class to use when it is necessary to be able to hold a value of ! 199: mode MODE in a reload register for which class CLASS would ! 200: ordinarily be used. ! 201: ! 202: Unlike `PREFERRED_RELOAD_CLASS', this macro should be used when ! 203: there are certain modes that simply can't go in certain reload ! 204: classes. ! 205: ! 206: The value is a register class; perhaps CLASS, or perhaps another, ! 207: smaller class. ! 208: ! 209: Don't define this macro unless the target machine has limitations ! 210: which require the macro to do something nontrivial. ! 211: ! 212: `SECONDARY_RELOAD_CLASS (CLASS, MODE, X)' ! 213: `SECONDARY_INPUT_RELOAD_CLASS (CLASS, MODE, X)' ! 214: `SECONDARY_OUTPUT_RELOAD_CLASS (CLASS, MODE, X)' ! 215: Many machines have some registers that cannot be copied directly ! 216: to or from memory or even from other types of registers. An ! 217: example is the `MQ' register, which on most machines, can only be ! 218: copied to or from general registers, but not memory. Some ! 219: machines allow copying all registers to and from memory, but ! 220: require a scratch register for stores to some memory locations ! 221: (e.g., those with symbolic address on the RT, and those with ! 222: certain symbolic address on the Sparc when compiling PIC). In ! 223: some cases, both an intermediate and a scratch register are ! 224: required. ! 225: ! 226: You should define these macros to indicate to the reload phase ! 227: that it may need to allocate at least one register for a reload in ! 228: addition to the register to contain the data. Specifically, if ! 229: copying X to a register CLASS in MODE requires an intermediate ! 230: register, you should define `SECONDARY_INPUT_RELOAD_CLASS' to ! 231: return the largest register class all of whose registers can be ! 232: used as intermediate registers or scratch registers. ! 233: ! 234: If copying a register CLASS in MODE to X requires an intermediate ! 235: or scratch register, you should define ! 236: `SECONDARY_OUTPUT_RELOAD_CLASS' to return the largest register ! 237: class required. If the requirements for input and output reloads ! 238: are the same, the macro `SECONDARY_RELOAD_CLASS' should be used ! 239: instead of defining both macros identically. ! 240: ! 241: The values returned by these macros are often `GENERAL_REGS'. ! 242: Return `NO_REGS' if no spare register is needed; i.e., if X can be ! 243: directly copied to or from a register of CLASS in MODE without ! 244: requiring a scratch register. Do not define this macro if it ! 245: would always return `NO_REGS'. ! 246: ! 247: If a scratch register is required (either with or without an ! 248: intermediate register), you should define patterns for ! 249: `reload_inM' or `reload_outM', as required (*note Standard ! 250: Names::.. These patterns, which will normally be implemented with ! 251: a `define_expand', should be similar to the `movM' patterns, ! 252: except that operand 2 is the scratch register. ! 253: ! 254: Define constraints for the reload register and scratch register ! 255: that contain a single register class. If the original reload ! 256: register (whose class is CLASS) can meet the constraint given in ! 257: the pattern, the value returned by these macros is used for the ! 258: class of the scratch register. Otherwise, two additional reload ! 259: registers are required. Their classes are obtained from the ! 260: constraints in the insn pattern. ! 261: ! 262: X might be a pseudo-register or a `subreg' of a pseudo-register, ! 263: which could either be in a hard register or in memory. Use ! 264: `true_regnum' to find out; it will return -1 if the pseudo is in ! 265: memory and the hard register number if it is in a register. ! 266: ! 267: These macros should not be used in the case where a particular ! 268: class of registers can only be copied to memory and not to another ! 269: class of registers. In that case, secondary reload registers are ! 270: not needed and would not be helpful. Instead, a stack location ! 271: must be used to perform the copy and the `movM' pattern should use ! 272: memory as a intermediate storage. This case often occurs between ! 273: floating-point and general registers. ! 274: ! 275: `SECONDARY_MEMORY_NEEDED (CLASS1, CLASS2, M)' ! 276: Certain machines have the property that some registers cannot be ! 277: copied to some other registers without using memory. Define this ! 278: macro on those machines to be a C expression that is non-zero if ! 279: objects of mode M in registers of CLASS1 can only be copied to ! 280: registers of class CLASS2 by storing a register of CLASS1 into ! 281: memory and loading that memory location into a register of CLASS2. ! 282: ! 283: Do not define this macro if its value would always be zero. ! 284: ! 285: `SMALL_REGISTER_CLASSES' ! 286: Normally the compiler will avoid choosing spill registers from ! 287: registers that have been explicitly mentioned in the rtl (these ! 288: registers are normally those used to pass parameters and return ! 289: values). However, some machines have so few registers of certain ! 290: classes that there would not be enough registers to use as spill ! 291: registers if this were done. ! 292: ! 293: On those machines, you should define `SMALL_REGISTER_CLASSES'. ! 294: When it is defined, the compiler allows registers explicitly used ! 295: in the rtl to be used as spill registers but prevents the compiler ! 296: from extending the lifetime of these registers. ! 297: ! 298: Defining this macro is always safe, but unnecessarily defining ! 299: this macro will reduce the amount of optimizations that can be ! 300: performed in some cases. If this macro is not defined but needs ! 301: to be, the compiler will run out of reload registers and print a ! 302: fatal error message. ! 303: ! 304: For most machines, this macro should not be defined. ! 305: ! 306: `CLASS_MAX_NREGS (CLASS, MODE)' ! 307: A C expression for the maximum number of consecutive registers of ! 308: class CLASS needed to hold a value of mode MODE. ! 309: ! 310: This is closely related to the macro `HARD_REGNO_NREGS'. In fact, ! 311: the value of the macro `CLASS_MAX_NREGS (CLASS, MODE)' should be ! 312: the maximum value of `HARD_REGNO_NREGS (REGNO, MODE)' for all ! 313: REGNO values in the class CLASS. ! 314: ! 315: This macro helps control the handling of multiple-word values in ! 316: the reload pass. ! 317: ! 318: Three other special macros describe which operands fit which ! 319: constraint letters. ! 320: ! 321: `CONST_OK_FOR_LETTER_P (VALUE, C)' ! 322: A C expression that defines the machine-dependent operand ! 323: constraint letters that specify particular ranges of integer ! 324: values. If C is one of those letters, the expression should check ! 325: that VALUE, an integer, is in the appropriate range and return 1 ! 326: if so, 0 otherwise. If C is not one of those letters, the value ! 327: should be 0 regardless of VALUE. ! 328: ! 329: `CONST_DOUBLE_OK_FOR_LETTER_P (VALUE, C)' ! 330: A C expression that defines the machine-dependent operand ! 331: constraint letters that specify particular ranges of ! 332: `const_double' values. ! 333: ! 334: If C is one of those letters, the expression should check that ! 335: VALUE, an RTX of code `const_double', is in the appropriate range ! 336: and return 1 if so, 0 otherwise. If C is not one of those ! 337: letters, the value should be 0 regardless of VALUE. ! 338: ! 339: `const_double' is used for all floating-point constants and for ! 340: `DImode' fixed-point constants. A given letter can accept either ! 341: or both kinds of values. It can use `GET_MODE' to distinguish ! 342: between these kinds. ! 343: ! 344: `EXTRA_CONSTRAINT (VALUE, C)' ! 345: A C expression that defines the optional machine-dependent ! 346: constraint letters that can be used to segregate specific types of ! 347: operands, usually memory references, for the target machine. ! 348: Normally this macro will not be defined. If it is required for a ! 349: particular target machine, it should return 1 if VALUE corresponds ! 350: to the operand type represented by the constraint letter C. If C ! 351: is not defined as an extra constraint, the value returned should ! 352: be 0 regardless of VALUE. ! 353: ! 354: For example, on the ROMP, load instructions cannot have their ! 355: output in r0 if the memory reference contains a symbolic address. ! 356: Constraint letter `Q' is defined as representing a memory address ! 357: that does *not* contain a symbolic address. An alternative is ! 358: specified with a `Q' constraint on the input and `r' on the ! 359: output. The next alternative specifies `m' on the input and a ! 360: register class that does not include r0 on the output. 1.1.1.3 root 361: 362: 1.1.1.4 ! root 363: File: gcc.info, Node: Stack and Calling, Next: Varargs, Prev: Register Classes, Up: Target Macros 1.1.1.3 root 364: 1.1.1.4 ! root 365: Describing Stack Layout and Calling Conventions ! 366: =============================================== ! 367: ! 368: * Menu: ! 369: ! 370: * Frame Layout:: ! 371: * Frame Registers:: ! 372: * Elimination:: ! 373: * Stack Arguments:: ! 374: * Register Arguments:: ! 375: * Scalar Return:: ! 376: * Aggregate Return:: ! 377: * Caller Saves:: ! 378: * Function Entry:: ! 379: * Profiling:: ! 380: ! 381: ! 382: File: gcc.info, Node: Frame Layout, Next: Frame Registers, Up: Stack and Calling ! 383: ! 384: Basic Stack Layout ! 385: ------------------ ! 386: ! 387: `STACK_GROWS_DOWNWARD' ! 388: Define this macro if pushing a word onto the stack moves the stack ! 389: pointer to a smaller address. ! 390: ! 391: When we say, "define this macro if ...," it means that the ! 392: compiler checks this macro only with `#ifdef' so the precise ! 393: definition used does not matter. ! 394: ! 395: `FRAME_GROWS_DOWNWARD' ! 396: Define this macro if the addresses of local variable slots are at ! 397: negative offsets from the frame pointer. ! 398: ! 399: `ARGS_GROW_DOWNWARD' ! 400: Define this macro if successive arguments to a function occupy ! 401: decreasing addresses on the stack. ! 402: ! 403: `STARTING_FRAME_OFFSET' ! 404: Offset from the frame pointer to the first local variable slot to ! 405: be allocated. ! 406: ! 407: If `FRAME_GROWS_DOWNWARD', the next slot's offset is found by ! 408: subtracting the length of the first slot from ! 409: `STARTING_FRAME_OFFSET'. Otherwise, it is found by adding the ! 410: length of the first slot to the value `STARTING_FRAME_OFFSET'. ! 411: ! 412: `STACK_POINTER_OFFSET' ! 413: Offset from the stack pointer register to the first location at ! 414: which outgoing arguments are placed. If not specified, the ! 415: default value of zero is used. This is the proper value for most ! 416: machines. ! 417: ! 418: If `ARGS_GROW_DOWNWARD', this is the offset to the location above ! 419: the first location at which outgoing arguments are placed. ! 420: ! 421: `FIRST_PARM_OFFSET (FUNDECL)' ! 422: Offset from the argument pointer register to the first argument's ! 423: address. On some machines it may depend on the data type of the ! 424: function. ! 425: ! 426: If `ARGS_GROW_DOWNWARD', this is the offset to the location above ! 427: the first argument's address. ! 428: ! 429: `STACK_DYNAMIC_OFFSET (FUNDECL)' ! 430: Offset from the stack pointer register to an item dynamically ! 431: allocated on the stack, e.g., by `alloca'. ! 432: ! 433: The default value for this macro is `STACK_POINTER_OFFSET' plus the ! 434: length of the outgoing arguments. The default is correct for most ! 435: machines. See `function.c' for details. ! 436: ! 437: `DYNAMIC_CHAIN_ADDRESS (FRAMEADDR)' ! 438: A C expression whose value is RTL representing the address in a ! 439: stack frame where the pointer to the caller's frame is stored. ! 440: Assume that FRAMEADDR is an RTL expression for the address of the ! 441: stack frame itself. ! 442: ! 443: If you don't define this macro, the default is to return the value ! 444: of FRAMEADDR--that is, the stack frame address is also the address ! 445: of the stack word that points to the previous frame. ! 446: ! 447: ! 448: File: gcc.info, Node: Frame Registers, Next: Elimination, Prev: Frame Layout, Up: Stack and Calling ! 449: ! 450: Registers That Address the Stack Frame ! 451: -------------------------------------- ! 452: ! 453: `STACK_POINTER_REGNUM' ! 454: The register number of the stack pointer register, which must also ! 455: be a fixed register according to `FIXED_REGISTERS'. On most ! 456: machines, the hardware determines which register this is. ! 457: ! 458: `FRAME_POINTER_REGNUM' ! 459: The register number of the frame pointer register, which is used to ! 460: access automatic variables in the stack frame. On some machines, ! 461: the hardware determines which register this is. On other ! 462: machines, you can choose any register you wish for this purpose. ! 463: ! 464: `ARG_POINTER_REGNUM' ! 465: The register number of the arg pointer register, which is used to ! 466: access the function's argument list. On some machines, this is ! 467: the same as the frame pointer register. On some machines, the ! 468: hardware determines which register this is. On other machines, ! 469: you can choose any register you wish for this purpose. If this is ! 470: not the same register as the frame pointer register, then you must ! 471: mark it as a fixed register according to `FIXED_REGISTERS', or ! 472: arrange to be able to eliminate it (*note Elimination::.). ! 473: ! 474: `STATIC_CHAIN_REGNUM' ! 475: `STATIC_CHAIN_INCOMING_REGNUM' ! 476: Register numbers used for passing a function's static chain ! 477: pointer. If register windows are used, ! 478: `STATIC_CHAIN_INCOMING_REGNUM' is the register number as seen by ! 479: the called function, while `STATIC_CHAIN_REGNUM' is the register ! 480: number as seen by the calling function. If these registers are ! 481: the same, `STATIC_CHAIN_INCOMING_REGNUM' need not be defined. ! 482: ! 483: The static chain register need not be a fixed register. ! 484: ! 485: If the static chain is passed in memory, these macros should not be ! 486: defined; instead, the next two macros should be defined. ! 487: ! 488: `STATIC_CHAIN' ! 489: `STATIC_CHAIN_INCOMING' ! 490: If the static chain is passed in memory, these macros provide rtx ! 491: giving `mem' expressions that denote where they are stored. ! 492: `STATIC_CHAIN' and `STATIC_CHAIN_INCOMING' give the locations as ! 493: seen by the calling and called functions, respectively. Often the ! 494: former will be at an offset from the stack pointer and the latter ! 495: at an offset from the frame pointer. ! 496: ! 497: The variables `stack_pointer_rtx', `frame_pointer_rtx', and ! 498: `arg_pointer_rtx' will have been initialized prior to the use of ! 499: these macros and should be used to refer to those items. ! 500: ! 501: If the static chain is passed in a register, the two previous ! 502: macros should be defined instead. ! 503: ! 504: ! 505: File: gcc.info, Node: Elimination, Next: Stack Arguments, Prev: Frame Registers, Up: Stack and Calling ! 506: ! 507: Eliminating Frame Pointer and Arg Pointer ! 508: ----------------------------------------- 1.1.1.3 root 509: 1.1.1.4 ! root 510: `FRAME_POINTER_REQUIRED' ! 511: A C expression which is nonzero if a function must have and use a ! 512: frame pointer. This expression is evaluated in the reload pass. ! 513: If its value is nonzero the function will have a frame pointer. ! 514: ! 515: The expression can in principle examine the current function and ! 516: decide according to the facts, but on most machines the constant 0 ! 517: or the constant 1 suffices. Use 0 when the machine allows code to ! 518: be generated with no frame pointer, and doing so saves some time ! 519: or space. Use 1 when there is no possible advantage to avoiding a ! 520: frame pointer. ! 521: ! 522: In certain cases, the compiler does not know how to produce valid ! 523: code without a frame pointer. The compiler recognizes those cases ! 524: and automatically gives the function a frame pointer regardless of ! 525: what `FRAME_POINTER_REQUIRED' says. You don't need to worry about ! 526: them. ! 527: ! 528: In a function that does not require a frame pointer, the frame ! 529: pointer register can be allocated for ordinary usage, unless you ! 530: mark it as a fixed register. See `FIXED_REGISTERS' for more ! 531: information. ! 532: ! 533: This macro is ignored and need not be defined if `ELIMINABLE_REGS' ! 534: is defined. ! 535: ! 536: `INITIAL_FRAME_POINTER_OFFSET (DEPTH-VAR)' ! 537: A C statement to store in the variable DEPTH-VAR the difference ! 538: between the frame pointer and the stack pointer values immediately ! 539: after the function prologue. The value would be computed from ! 540: information such as the result of `get_frame_size ()' and the ! 541: tables of registers `regs_ever_live' and `call_used_regs'. ! 542: ! 543: If `ELIMINABLE_REGS' is defined, this macro will be not be used and ! 544: need not be defined. Otherwise, it must be defined even if ! 545: `FRAME_POINTER_REQUIRED' is defined to always be true; in that ! 546: case, you may set DEPTH-VAR to anything. ! 547: ! 548: `ELIMINABLE_REGS' ! 549: If defined, this macro specifies a table of register pairs used to ! 550: eliminate unneeded registers that point into the stack frame. If ! 551: it is not defined, the only elimination attempted by the compiler ! 552: is to replace references to the frame pointer with references to ! 553: the stack pointer. ! 554: ! 555: The definition of this macro is a list of structure ! 556: initializations, each of which specifies an original and ! 557: replacement register. ! 558: ! 559: On some machines, the position of the argument pointer is not ! 560: known until the compilation is completed. In such a case, a ! 561: separate hard register must be used for the argument pointer. ! 562: This register can be eliminated by replacing it with either the ! 563: frame pointer or the argument pointer, depending on whether or not ! 564: the frame pointer has been eliminated. ! 565: ! 566: In this case, you might specify: ! 567: #define ELIMINABLE_REGS \ ! 568: {{ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ ! 569: {ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}, \ ! 570: {FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}} ! 571: ! 572: Note that the elimination of the argument pointer with the stack ! 573: pointer is specified first since that is the preferred elimination. ! 574: ! 575: `CAN_ELIMINATE (FROM-REG, TO-REG)' ! 576: A C expression that returns non-zero if the compiler is allowed to ! 577: try to replace register number FROM-REG with register number ! 578: TO-REG. This macro need only be defined if `ELIMINABLE_REGS' is ! 579: defined, and will usually be the constant 1, since most of the ! 580: cases preventing register elimination are things that the compiler ! 581: already knows about. ! 582: ! 583: `INITIAL_ELIMINATION_OFFSET (FROM-REG, TO-REG, OFFSET-VAR)' ! 584: This macro is similar to `INITIAL_FRAME_POINTER_OFFSET'. It ! 585: specifies the initial difference between the specified pair of ! 586: registers. This macro must be defined if `ELIMINABLE_REGS' is ! 587: defined. ! 588: ! 589: `LONGJMP_RESTORE_FROM_STACK' ! 590: Define this macro if the `longjmp' function restores registers from ! 591: the stack frames, rather than from those saved specifically by ! 592: `setjmp'. Certain quantities must not be kept in registers across ! 593: a call to `setjmp' on such machines. 1.1.1.3 root 594: 595: 1.1.1.4 ! root 596: File: gcc.info, Node: Stack Arguments, Next: Register Arguments, Prev: Elimination, Up: Stack and Calling ! 597: ! 598: Passing Function Arguments on the Stack ! 599: --------------------------------------- ! 600: ! 601: The macros in this section control how arguments are passed on the ! 602: stack. See the following section for other macros that control passing ! 603: certain arguments in registers. ! 604: ! 605: `PROMOTE_PROTOTYPES' ! 606: Define this macro if an argument declared as `char' or `short' in ! 607: a prototype should actually be passed as an `int'. In addition to ! 608: avoiding errors in certain cases of mismatch, it also makes for ! 609: better code on certain machines. ! 610: ! 611: `PUSH_ROUNDING (NPUSHED)' ! 612: A C expression that is the number of bytes actually pushed onto the ! 613: stack when an instruction attempts to push NPUSHED bytes. 1.1.1.3 root 614: 1.1.1.4 ! root 615: If the target machine does not have a push instruction, do not ! 616: define this macro. That directs GNU CC to use an alternate ! 617: strategy: to allocate the entire argument block and then store the ! 618: arguments into it. 1.1.1.3 root 619: 1.1.1.4 ! root 620: On some machines, the definition 1.1.1.3 root 621: 1.1.1.4 ! root 622: #define PUSH_ROUNDING(BYTES) (BYTES) ! 623: ! 624: will suffice. But on other machines, instructions that appear to ! 625: push one byte actually push two bytes in an attempt to maintain ! 626: alignment. Then the definition should be ! 627: ! 628: #define PUSH_ROUNDING(BYTES) (((BYTES) + 1) & ~1) ! 629: ! 630: `ACCUMULATE_OUTGOING_ARGS' ! 631: If defined, the maximum amount of space required for outgoing ! 632: arguments will be computed and placed into the variable ! 633: `current_function_outgoing_args_size'. No space will be pushed ! 634: onto the stack for each call; instead, the function prologue should ! 635: increase the stack frame size by this amount. ! 636: ! 637: It is not proper to define both `PUSH_ROUNDING' and ! 638: `ACCUMULATE_OUTGOING_ARGS'. ! 639: ! 640: `REG_PARM_STACK_SPACE (FNDECL)' ! 641: Define this macro if functions should assume that stack space has ! 642: been allocated for arguments even when their values are passed in 1.1.1.3 root 643: registers. 644: 1.1.1.4 ! root 645: The value of this macro is the size, in bytes, of the area ! 646: reserved for arguments passed in registers for the function ! 647: represented by FNDECL. ! 648: ! 649: This space can either be allocated by the caller or be a part of ! 650: the machine-dependent stack frame: `OUTGOING_REG_PARM_STACK_SPACE' ! 651: says which. ! 652: ! 653: `MAYBE_REG_PARM_STACK_SPACE' ! 654: `FINAL_REG_PARM_STACK_SPACE (CONST_SIZE, VAR_SIZE)' ! 655: Define these macros in addition to the one above if functions might ! 656: allocate stack space for arguments even when their values are ! 657: passed in registers. These should be used when the stack space ! 658: allocated for arguments in registers is not a simple constant ! 659: independent of the function declaration. ! 660: ! 661: The value of the first macro is the size, in bytes, of the area ! 662: that we should initially assume would be reserved for arguments ! 663: passed in registers. ! 664: ! 665: The value of the second macro is the actual size, in bytes, of the ! 666: area that will be reserved for arguments passed in registers. ! 667: This takes two arguments: an integer representing the number of ! 668: bytes of fixed sized arguments on the stack, and a tree ! 669: representing the number of bytes of variable sized arguments on 1.1.1.3 root 670: the stack. 671: 1.1.1.4 ! root 672: When these macros are defined, `REG_PARM_STACK_SPACE' will only be ! 673: called for libcall functions, the current function, or for a ! 674: function being called when it is known that such stack space must ! 675: be allocated. In each case this value can be easily computed. ! 676: ! 677: When deciding whether a called function needs such stack space, ! 678: and how much space to reserve, GNU CC uses these two macros ! 679: instead of `REG_PARM_STACK_SPACE'. ! 680: ! 681: `OUTGOING_REG_PARM_STACK_SPACE' ! 682: Define this if it is the responsibility of the caller to allocate ! 683: the area reserved for arguments passed in registers. ! 684: ! 685: If `ACCUMULATE_OUTGOING_ARGS' is defined, this macro controls ! 686: whether the space for these arguments counts in the value of ! 687: `current_function_outgoing_args_size'. ! 688: ! 689: `STACK_PARMS_IN_REG_PARM_AREA' ! 690: Define this macro if `REG_PARM_STACK_SPACE' is defined but stack ! 691: parameters don't skip the area specified by `REG_PARM_STACK_SPACE'. ! 692: ! 693: Normally, when a parameter is not passed in registers, it is ! 694: placed on the stack beyond the `REG_PARM_STACK_SPACE' area. ! 695: Defining this macro suppresses this behavior and causes the ! 696: parameter to be passed on the stack in its natural location. ! 697: ! 698: `RETURN_POPS_ARGS (FUNTYPE, STACK-SIZE)' ! 699: A C expression that should indicate the number of bytes of its own ! 700: arguments that a function pops on returning, or 0 if the function ! 701: pops no arguments and the caller must therefore pop them all after ! 702: the function returns. ! 703: ! 704: FUNTYPE is a C variable whose value is a tree node that describes ! 705: the function in question. Normally it is a node of type ! 706: `FUNCTION_TYPE' that describes the data type of the function. From ! 707: this it is possible to obtain the data types of the value and ! 708: arguments (if known). ! 709: ! 710: When a call to a library function is being considered, FUNTYPE ! 711: will contain an identifier node for the library function. Thus, if ! 712: you need to distinguish among various library functions, you can ! 713: do so by their names. Note that "library function" in this ! 714: context means a function used to perform arithmetic, whose name is ! 715: known specially in the compiler and was not mentioned in the C ! 716: code being compiled. ! 717: ! 718: STACK-SIZE is the number of bytes of arguments passed on the ! 719: stack. If a variable number of bytes is passed, it is zero, and ! 720: argument popping will always be the responsibility of the calling ! 721: function. ! 722: ! 723: On the Vax, all functions always pop their arguments, so the ! 724: definition of this macro is STACK-SIZE. On the 68000, using the ! 725: standard calling convention, no functions pop their arguments, so ! 726: the value of the macro is always 0 in this case. But an ! 727: alternative calling convention is available in which functions ! 728: that take a fixed number of arguments pop them but other functions ! 729: (such as `printf') pop nothing (the caller pops all). When this ! 730: convention is in use, FUNTYPE is examined to determine whether a ! 731: function takes a fixed number of arguments. 1.1.1.3 root 732: 733: 1.1.1.4 ! root 734: File: gcc.info, Node: Register Arguments, Next: Scalar Return, Prev: Stack Arguments, Up: Stack and Calling 1.1.1.3 root 735: 1.1.1.4 ! root 736: Passing Arguments in Registers ! 737: ------------------------------ 1.1.1.3 root 738: 1.1.1.4 ! root 739: This section describes the macros which let you control how various ! 740: types of arguments are passed in registers or how they are arranged in ! 741: the stack. ! 742: ! 743: `FUNCTION_ARG (CUM, MODE, TYPE, NAMED)' ! 744: A C expression that controls whether a function argument is passed ! 745: in a register, and which register. ! 746: ! 747: The arguments are CUM, which summarizes all the previous ! 748: arguments; MODE, the machine mode of the argument; TYPE, the data ! 749: type of the argument as a tree node or 0 if that is not known ! 750: (which happens for C support library functions); and NAMED, which ! 751: is 1 for an ordinary argument and 0 for nameless arguments that ! 752: correspond to `...' in the called function's prototype. ! 753: ! 754: The value of the expression should either be a `reg' RTX for the ! 755: hard register in which to pass the argument, or zero to pass the ! 756: argument on the stack. ! 757: ! 758: For machines like the Vax and 68000, where normally all arguments ! 759: are pushed, zero suffices as a definition. ! 760: ! 761: The usual way to make the ANSI library `stdarg.h' work on a machine ! 762: where some arguments are usually passed in registers, is to cause ! 763: nameless arguments to be passed on the stack instead. This is done ! 764: by making `FUNCTION_ARG' return 0 whenever NAMED is 0. ! 765: ! 766: You may use the macro `MUST_PASS_IN_STACK (MODE, TYPE)' in the ! 767: definition of this macro to determine if this argument is of a ! 768: type that must be passed in the stack. If `REG_PARM_STACK_SPACE' ! 769: is not defined and `FUNCTION_ARG' returns non-zero for such an ! 770: argument, the compiler will abort. If `REG_PARM_STACK_SPACE' is ! 771: defined, the argument will be computed in the stack and then ! 772: loaded into a register. ! 773: ! 774: `FUNCTION_INCOMING_ARG (CUM, MODE, TYPE, NAMED)' ! 775: Define this macro if the target machine has "register windows", so ! 776: that the register in which a function sees an arguments is not ! 777: necessarily the same as the one in which the caller passed the ! 778: argument. ! 779: ! 780: For such machines, `FUNCTION_ARG' computes the register in which ! 781: the caller passes the value, and `FUNCTION_INCOMING_ARG' should be ! 782: defined in a similar fashion to tell the function being called ! 783: where the arguments will arrive. ! 784: ! 785: If `FUNCTION_INCOMING_ARG' is not defined, `FUNCTION_ARG' serves ! 786: both purposes. ! 787: ! 788: `FUNCTION_ARG_PARTIAL_NREGS (CUM, MODE, TYPE, NAMED)' ! 789: A C expression for the number of words, at the beginning of an ! 790: argument, must be put in registers. The value must be zero for ! 791: arguments that are passed entirely in registers or that are ! 792: entirely pushed on the stack. ! 793: ! 794: On some machines, certain arguments must be passed partially in ! 795: registers and partially in memory. On these machines, typically ! 796: the first N words of arguments are passed in registers, and the ! 797: rest on the stack. If a multi-word argument (a `double' or a ! 798: structure) crosses that boundary, its first few words must be ! 799: passed in registers and the rest must be pushed. This macro tells ! 800: the compiler when this occurs, and how many of the words should go ! 801: in registers. ! 802: ! 803: `FUNCTION_ARG' for these arguments should return the first ! 804: register to be used by the caller for this argument; likewise ! 805: `FUNCTION_INCOMING_ARG', for the called function. ! 806: ! 807: `FUNCTION_ARG_PASS_BY_REFERENCE (CUM, MODE, TYPE, NAMED)' ! 808: A C expression that indicates when an argument must be passed by ! 809: reference. If nonzero for an argument, a copy of that argument is ! 810: made in memory and a pointer to the argument is passed instead of ! 811: the argument itself. The pointer is passed in whatever way is ! 812: appropriate for passing a pointer to that type. ! 813: ! 814: On machines where `REG_PARM_STACK_SPACE' is not defined, a suitable ! 815: definition of this macro might be ! 816: #define FUNCTION_ARG_PASS_BY_REFERENCE(CUM, MODE, TYPE, NAMED) \ ! 817: MUST_PASS_IN_STACK (MODE, TYPE) ! 818: ! 819: `CUMULATIVE_ARGS' ! 820: A C type for declaring a variable that is used as the first ! 821: argument of `FUNCTION_ARG' and other related values. For some ! 822: target machines, the type `int' suffices and can hold the number ! 823: of bytes of argument so far. ! 824: ! 825: There is no need to record in `CUMULATIVE_ARGS' anything about the ! 826: arguments that have been passed on the stack. The compiler has ! 827: other variables to keep track of that. For target machines on ! 828: which all arguments are passed on the stack, there is no need to ! 829: store anything in `CUMULATIVE_ARGS'; however, the data structure ! 830: must exist and should not be empty, so use `int'. ! 831: ! 832: `INIT_CUMULATIVE_ARGS (CUM, FNTYPE, LIBNAME)' ! 833: A C statement (sans semicolon) for initializing the variable CUM ! 834: for the state at the beginning of the argument list. The variable ! 835: has type `CUMULATIVE_ARGS'. The value of FNTYPE is the tree node ! 836: for the data type of the function which will receive the args, or 0 ! 837: if the args are to a compiler support library function. ! 838: ! 839: When processing a call to a compiler support library function, ! 840: LIBNAME identifies which one. It is a `symbol_ref' rtx which ! 841: contains the name of the function, as a string. LIBNAME is 0 when ! 842: an ordinary C function call is being processed. Thus, each time ! 843: this macro is called, either LIBNAME or FNTYPE is nonzero, but ! 844: never both of them at once. ! 845: ! 846: `INIT_CUMULATIVE_INCOMING_ARGS (CUM, FNTYPE, LIBNAME)' ! 847: Like `INIT_CUMULATIVE_ARGS' but overrides it for the purposes of ! 848: finding the arguments for the function being compiled. If this ! 849: macro is undefined, `INIT_CUMULATIVE_ARGS' is used instead. ! 850: ! 851: The argument LIBNAME exists for symmetry with ! 852: `INIT_CUMULATIVE_ARGS'. The value passed for LIBNAME is always 0, ! 853: since library routines with special calling conventions are never ! 854: compiled with GNU CC. ! 855: ! 856: `FUNCTION_ARG_ADVANCE (CUM, MODE, TYPE, NAMED)' ! 857: A C statement (sans semicolon) to update the summarizer variable ! 858: CUM to advance past an argument in the argument list. The values ! 859: MODE, TYPE and NAMED describe that argument. Once this is done, ! 860: the variable CUM is suitable for analyzing the *following* ! 861: argument with `FUNCTION_ARG', etc. ! 862: ! 863: This macro need not do anything if the argument in question was ! 864: passed on the stack. The compiler knows how to track the amount ! 865: of stack space used for arguments without any special help. ! 866: ! 867: `FUNCTION_ARG_PADDING (MODE, TYPE)' ! 868: If defined, a C expression which determines whether, and in which ! 869: direction, to pad out an argument with extra space. The value ! 870: should be of type `enum direction': either `upward' to pad above ! 871: the argument, `downward' to pad below, or `none' to inhibit ! 872: padding. ! 873: ! 874: This macro does not control the *amount* of padding; that is ! 875: always just enough to reach the next multiple of ! 876: `FUNCTION_ARG_BOUNDARY'. ! 877: ! 878: This macro has a default definition which is right for most ! 879: systems. For little-endian machines, the default is to pad upward. ! 880: For big-endian machines, the default is to pad downward for an ! 881: argument of constant size shorter than an `int', and upward ! 882: otherwise. ! 883: ! 884: `FUNCTION_ARG_BOUNDARY (MODE, TYPE)' ! 885: If defined, a C expression that gives the alignment boundary, in ! 886: bits, of an argument with the specified mode and type. If it is ! 887: not defined, `PARM_BOUNDARY' is used for all arguments. ! 888: ! 889: `FUNCTION_ARG_REGNO_P (REGNO)' ! 890: A C expression that is nonzero if REGNO is the number of a hard ! 891: register in which function arguments are sometimes passed. This ! 892: does *not* include implicit arguments such as the static chain and ! 893: the structure-value address. On many machines, no registers can be ! 894: used for this purpose since all function arguments are pushed on ! 895: the stack. 1.1.1.3 root 896: 897: 1.1.1.4 ! root 898: File: gcc.info, Node: Scalar Return, Next: Aggregate Return, Prev: Register Arguments, Up: Stack and Calling 1.1.1.3 root 899: 1.1.1.4 ! root 900: How Scalar Function Values Are Returned ! 901: --------------------------------------- 1.1.1.3 root 902: 1.1.1.4 ! root 903: This section discusses the macros that control returning scalars as ! 904: values--values that can fit in registers. 1.1.1.3 root 905: 1.1.1.4 ! root 906: `TRADITIONAL_RETURN_FLOAT' ! 907: Define this macro if `-traditional' should not cause functions ! 908: declared to return `float' to convert the value to `double'. ! 909: ! 910: `FUNCTION_VALUE (VALTYPE, FUNC)' ! 911: A C expression to create an RTX representing the place where a ! 912: function returns a value of data type VALTYPE. VALTYPE is a tree ! 913: node representing a data type. Write `TYPE_MODE (VALTYPE)' to get ! 914: the machine mode used to represent that type. On many machines, ! 915: only the mode is relevant. (Actually, on most machines, scalar ! 916: values are returned in the same place regardless of mode). ! 917: ! 918: If `PROMOTE_FUNCTION_RETURN' is defined, you must apply the same ! 919: promotion rules specified in `PROMOTE_MODE' if VALTYPE is a scalar ! 920: type. ! 921: ! 922: If the precise function being called is known, FUNC is a tree node ! 923: (`FUNCTION_DECL') for it; otherwise, FUNC is a null pointer. This ! 924: makes it possible to use a different value-returning convention ! 925: for specific functions when all their calls are known. ! 926: ! 927: `FUNCTION_VALUE' is not used for return vales with aggregate data ! 928: types, because these are returned in another way. See ! 929: `STRUCT_VALUE_REGNUM' and related macros, below. ! 930: ! 931: `FUNCTION_OUTGOING_VALUE (VALTYPE, FUNC)' ! 932: Define this macro if the target machine has "register windows" so ! 933: that the register in which a function returns its value is not the ! 934: same as the one in which the caller sees the value. ! 935: ! 936: For such machines, `FUNCTION_VALUE' computes the register in which ! 937: the caller will see the value, and `FUNCTION_OUTGOING_VALUE' ! 938: should be defined in a similar fashion to tell the function where ! 939: to put the value. ! 940: ! 941: If `FUNCTION_OUTGOING_VALUE' is not defined, `FUNCTION_VALUE' ! 942: serves both purposes. ! 943: ! 944: `FUNCTION_OUTGOING_VALUE' is not used for return vales with ! 945: aggregate data types, because these are returned in another way. ! 946: See `STRUCT_VALUE_REGNUM' and related macros, below. ! 947: ! 948: `LIBCALL_VALUE (MODE)' ! 949: A C expression to create an RTX representing the place where a ! 950: library function returns a value of mode MODE. If the precise ! 951: function being called is known, FUNC is a tree node ! 952: (`FUNCTION_DECL') for it; otherwise, FUNC is a null pointer. This ! 953: makes it possible to use a different value-returning convention ! 954: for specific functions when all their calls are known. ! 955: ! 956: Note that "library function" in this context means a compiler ! 957: support routine, used to perform arithmetic, whose name is known ! 958: specially by the compiler and was not mentioned in the C code being ! 959: compiled. ! 960: ! 961: The definition of `LIBRARY_VALUE' need not be concerned aggregate ! 962: data types, because none of the library functions returns such ! 963: types. ! 964: ! 965: `FUNCTION_VALUE_REGNO_P (REGNO)' ! 966: A C expression that is nonzero if REGNO is the number of a hard ! 967: register in which the values of called function may come back. ! 968: ! 969: A register whose use for returning values is limited to serving as ! 970: the second of a pair (for a value of type `double', say) need not ! 971: be recognized by this macro. So for most machines, this definition ! 972: suffices: ! 973: ! 974: #define FUNCTION_VALUE_REGNO_P(N) ((N) == 0) ! 975: ! 976: If the machine has register windows, so that the caller and the ! 977: called function use different registers for the return value, this ! 978: macro should recognize only the caller's register numbers. 1.1.1.3 root 979: 1.1.1.4 ! root 980: ! 981: File: gcc.info, Node: Aggregate Return, Next: Caller Saves, Prev: Scalar Return, Up: Stack and Calling 1.1.1.3 root 982: 1.1.1.4 ! root 983: How Large Values Are Returned ! 984: ----------------------------- 1.1.1.3 root 985: 1.1.1.4 ! root 986: When a function value's mode is `BLKmode' (and in some other cases), ! 987: the value is not returned according to `FUNCTION_VALUE' (*note Scalar ! 988: Return::.). Instead, the caller passes the address of a block of ! 989: memory in which the value should be stored. This address is called the ! 990: "structure value address". ! 991: ! 992: This section describes how to control returning structure values in ! 993: memory. ! 994: ! 995: `RETURN_IN_MEMORY (TYPE)' ! 996: A C expression which can inhibit the returning of certain function ! 997: values in registers, based on the type of value. A nonzero value ! 998: says to return the function value in memory, just as large ! 999: structures are always returned. Here TYPE will be a C expression ! 1000: of type `tree', representing the data type of the value. ! 1001: ! 1002: Note that values of mode `BLKmode' are returned in memory ! 1003: regardless of this macro. Also, the option `-fpcc-struct-return' ! 1004: takes effect regardless of this macro. On most systems, it is ! 1005: possible to leave the macro undefined; this causes a default ! 1006: definition to be used, whose value is the constant 0. ! 1007: ! 1008: `STRUCT_VALUE_REGNUM' ! 1009: If the structure value address is passed in a register, then ! 1010: `STRUCT_VALUE_REGNUM' should be the number of that register. ! 1011: ! 1012: `STRUCT_VALUE' ! 1013: If the structure value address is not passed in a register, define ! 1014: `STRUCT_VALUE' as an expression returning an RTX for the place ! 1015: where the address is passed. If it returns 0, the address is ! 1016: passed as an "invisible" first argument. ! 1017: ! 1018: `STRUCT_VALUE_INCOMING_REGNUM' ! 1019: On some architectures the place where the structure value address ! 1020: is found by the called function is not the same place that the ! 1021: caller put it. This can be due to register windows, or it could ! 1022: be because the function prologue moves it to a different place. ! 1023: ! 1024: If the incoming location of the structure value address is in a ! 1025: register, define this macro as the register number. ! 1026: ! 1027: `STRUCT_VALUE_INCOMING' ! 1028: If the incoming location is not a register, define ! 1029: `STRUCT_VALUE_INCOMING' as an expression for an RTX for where the ! 1030: called function should find the value. If it should find the ! 1031: value on the stack, define this to create a `mem' which refers to ! 1032: the frame pointer. A definition of 0 means that the address is ! 1033: passed as an "invisible" first argument. ! 1034: ! 1035: `PCC_STATIC_STRUCT_RETURN' ! 1036: Define this macro if the usual system convention on the target ! 1037: machine for returning structures and unions is for the called ! 1038: function to return the address of a static variable containing the ! 1039: value. GNU CC does not normally use this convention, even if it ! 1040: is the usual one, but does use it if `-fpcc-struct-return' is ! 1041: specified. 1.1.1.3 root 1042: 1.1.1.4 ! root 1043: Do not define this if the usual system convention is for the ! 1044: caller to pass an address to the subroutine. 1.1.1.3 root 1045: 1046: 1.1.1.4 ! root 1047: File: gcc.info, Node: Caller Saves, Next: Function Entry, Prev: Aggregate Return, Up: Stack and Calling 1.1.1.3 root 1048: 1.1.1.4 ! root 1049: Caller-Saves Register Allocation ! 1050: -------------------------------- 1.1.1.3 root 1051: 1.1.1.4 ! root 1052: If you enable it, GNU CC can save registers around function calls. ! 1053: This makes it possible to use call-clobbered registers to hold ! 1054: variables that must live across calls. ! 1055: ! 1056: `DEFAULT_CALLER_SAVES' ! 1057: Define this macro if function calls on the target machine do not ! 1058: preserve any registers; in other words, if `CALL_USED_REGISTERS' ! 1059: has 1 for all registers. This macro enables `-fcaller-saves' by ! 1060: default. Eventually that option will be enabled by default on all ! 1061: machines and both the option and this macro will be eliminated. ! 1062: ! 1063: `CALLER_SAVE_PROFITABLE (REFS, CALLS)' ! 1064: A C expression to determine whether it is worthwhile to consider ! 1065: placing a pseudo-register in a call-clobbered hard register and ! 1066: saving and restoring it around each function call. The expression ! 1067: should be 1 when this is worth doing, and 0 otherwise. 1.1 root 1068: 1.1.1.4 ! root 1069: If you don't define this macro, a default is used which is good on ! 1070: most machines: `4 * CALLS < REFS'. 1.1 root 1071: 1072:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.