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