]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
reginfo.c (init_reg_sets_1): Adjust comments.
authorNathan Froyd <froydnj@codesourcery.com>
Tue, 29 Jun 2010 12:18:36 +0000 (12:18 +0000)
committerNathan Froyd <froydnj@gcc.gnu.org>
Tue, 29 Jun 2010 12:18:36 +0000 (12:18 +0000)
* reginfo.c (init_reg_sets_1): Adjust comments.
* combine-stack-adj.c (rest_of_handle_stack_adjustments): Likewise.
* calls.c (prepare_call_address): Likewise.
(emit_call_1): Use targetm.calls.return_pops_args.
(expand_call): Likewise.
* function.c (assign_parms): Likewise.
* system.h (RETURN_POPS_ARGS): Add to #pragma poison list.
* target.h (struct gcc_target) [struct calls]: Add
return_pops_args field.
* targhooks.h (default_return_pops_args): Declare.
* targhooks.c (default_return_pops_args): Define.
* target-def.h (TARGET_RETURN_POPS_ARGS): Define.
(TARGET_CALLS): Add TARGET_RETURN_POPS_ARGS.
* doc/tm.texi (RETURN_POPS_ARGS): Rename to...
(TARGET_RETURN_POPS_ARGS): ...this.  Use deftypefn.  Adjust
documentation.
* config/alpha/alpha.h (RETURN_POPS_ARGS): Delete.
* config/arc/arc.h (RETURN_POPS_ARGS): Likewise.
* config/arm/arm.h (RETURN_POPS_ARGS): Likewise.
* config/avr/avr.h (RETURN_POPS_ARGS): Likewise.
* config/bfin/bfin.h (RETURN_POPS_ARGS): Likewise.
* config/cris/cris.h (RETURN_POPS_ARGS): Likewise.
* config/crx/crx.h (RETURN_POPS_ARGS): Likewise.
* config/fr30/fr30.h (RETURN_POPS_ARGS): Likewise.
* config/frv/frv.h (RETURN_POPS_ARGS): Likewise.
* config/h8300/h8300.h (RETURN_POPS_ARGS): Likewise.
* config/ia64/ia64.h (RETURN_POPS_ARGS): Likewise.
* config/iq2000/iq2000.h (RETURN_POPS_ARGS): Likewise.
* config/lm32/lm32.h (RETURN_POPS_ARGS): Likewise.
* config/m32c/m32c.h (RETURN_POPS_ARGS): Likewise.
* config/m32r/m32r.h (RETURN_POPS_ARGS): Likewise.
* config/m68hc11/m68hc11.h (RETURN_POPS_ARGS): Likewise.
* config/mcore/mcore.h (RETURN_POPS_ARGS): Likewise.
* config/mep/mep.h (RETURN_POPS_ARGS): Likewise.
* config/mips/mips.h (RETURN_POPS_ARGS): Likewise.
* config/mmix/mmix.h (RETURN_POPS_ARGS): Likewise.
* config/mn10300/mn10300.h (RETURN_POPS_ARGS): Likewise.
* config/moxie/moxie.h (RETURN_POPS_ARGS): Likewise.
* config/pa/pa.h (RETURN_POPS_ARGS): Likewise.
* config/pdp11/pdp11.h (RETURN_POPS_ARGS): Likewise.
* config/picochip/picochip.h (RETURN_POPS_ARGS): Likewise.
* config/rs6000/rs6000.h (RETURN_POPS_ARGS): Likewise.
* config/rx/rx.h (RETURN_POPS_ARGS): Likewise.
* config/s390/s390.h (RETURN_POPS_ARGS): Likewise.
* config/score/score.h (RETURN_POPS_ARGS): Likewise.
* config/sh/sh.h (RETURN_POPS_ARGS): Likewise.
* config/sparc/sparc.h (RETURN_POPS_ARGS): Likewise.
* config/spu/spu.h (RETURN_POPS_ARGS): Likewise.
* config/stormy16/stormy16.h (RETURN_POPS_ARGS): Likewise.
* config/v850/v850.h (RETURN_POPS_ARGS): Likewise.
* config/xtensa/xtensa.h (RETURN_POPS_ARGS): Likewise.
* config/i386/i386-protos.h (ix86_return_pops_args): Delete.
* config/i386/i386.h (RETURN_POPS_ARGS): Delete.
* config/i386/i386.c (ix86_return_pops_args): Make static.
Constify arguments.
(TARGET_RETURN_POPS_ARGS): Define.
* config/m68k/m68k.h (RETURN_POPS_ARGS): Move to...
* config/m68k/m68k.c (m68k_return_pops_args): ...here.  New function.
(TARGET_RETURN_POPS_ARGS): Define.
* config/vax/vax.h (RETURN_POPS_ARGS): Move to...
* config/vax/vax.c (vax_return_pops_args): ...here.  New function.
(TARGET_RETURN_POPS_ARGS): Define.

From-SVN: r161528

53 files changed:
gcc/ChangeLog
gcc/calls.c
gcc/combine-stack-adj.c
gcc/config/alpha/alpha.h
gcc/config/arc/arc.h
gcc/config/arm/arm.h
gcc/config/avr/avr.h
gcc/config/bfin/bfin.h
gcc/config/cris/cris.h
gcc/config/crx/crx.h
gcc/config/fr30/fr30.h
gcc/config/frv/frv.h
gcc/config/h8300/h8300.h
gcc/config/i386/i386-protos.h
gcc/config/i386/i386.c
gcc/config/i386/i386.h
gcc/config/ia64/ia64.h
gcc/config/iq2000/iq2000.h
gcc/config/lm32/lm32.h
gcc/config/m32c/m32c.h
gcc/config/m32r/m32r.h
gcc/config/m68hc11/m68hc11.h
gcc/config/m68k/m68k.c
gcc/config/m68k/m68k.h
gcc/config/mcore/mcore.h
gcc/config/mep/mep.h
gcc/config/mips/mips.h
gcc/config/mmix/mmix.h
gcc/config/mn10300/mn10300.h
gcc/config/moxie/moxie.h
gcc/config/pa/pa.h
gcc/config/pdp11/pdp11.h
gcc/config/picochip/picochip.h
gcc/config/rs6000/rs6000.h
gcc/config/rx/rx.h
gcc/config/s390/s390.h
gcc/config/score/score.h
gcc/config/sh/sh.h
gcc/config/sparc/sparc.h
gcc/config/spu/spu.h
gcc/config/stormy16/stormy16.h
gcc/config/v850/v850.h
gcc/config/vax/vax.c
gcc/config/vax/vax.h
gcc/config/xtensa/xtensa.h
gcc/doc/tm.texi
gcc/function.c
gcc/reginfo.c
gcc/system.h
gcc/target-def.h
gcc/target.h
gcc/targhooks.c
gcc/targhooks.h

index 2a645299e395dfd2ba733ae8bc262bc9a5f3e920..d1cb9a912eaf4cd02e5fe13bb7d12cc05cfe6a96 100644 (file)
@@ -1,3 +1,68 @@
+2010-06-29  Nathan Froyd  <froydnj@codesourcery.com>
+
+       * reginfo.c (init_reg_sets_1): Adjust comments.
+       * combine-stack-adj.c (rest_of_handle_stack_adjustments): Likewise.
+       * calls.c (prepare_call_address): Likewise.
+       (emit_call_1): Use targetm.calls.return_pops_args.
+       (expand_call): Likewise.
+       * function.c (assign_parms): Likewise.
+       * system.h (RETURN_POPS_ARGS): Add to #pragma poison list.
+       * target.h (struct gcc_target) [struct calls]: Add
+       return_pops_args field.
+       * targhooks.h (default_return_pops_args): Declare.
+       * targhooks.c (default_return_pops_args): Define.
+       * target-def.h (TARGET_RETURN_POPS_ARGS): Define.
+       (TARGET_CALLS): Add TARGET_RETURN_POPS_ARGS.
+       * doc/tm.texi (RETURN_POPS_ARGS): Rename to...
+       (TARGET_RETURN_POPS_ARGS): ...this.  Use deftypefn.  Adjust
+       documentation.
+       * config/alpha/alpha.h (RETURN_POPS_ARGS): Delete.
+       * config/arc/arc.h (RETURN_POPS_ARGS): Likewise.
+       * config/arm/arm.h (RETURN_POPS_ARGS): Likewise.
+       * config/avr/avr.h (RETURN_POPS_ARGS): Likewise.
+       * config/bfin/bfin.h (RETURN_POPS_ARGS): Likewise.
+       * config/cris/cris.h (RETURN_POPS_ARGS): Likewise.
+       * config/crx/crx.h (RETURN_POPS_ARGS): Likewise.
+       * config/fr30/fr30.h (RETURN_POPS_ARGS): Likewise.
+       * config/frv/frv.h (RETURN_POPS_ARGS): Likewise.
+       * config/h8300/h8300.h (RETURN_POPS_ARGS): Likewise.
+       * config/ia64/ia64.h (RETURN_POPS_ARGS): Likewise.
+       * config/iq2000/iq2000.h (RETURN_POPS_ARGS): Likewise.
+       * config/lm32/lm32.h (RETURN_POPS_ARGS): Likewise.
+       * config/m32c/m32c.h (RETURN_POPS_ARGS): Likewise.
+       * config/m32r/m32r.h (RETURN_POPS_ARGS): Likewise.
+       * config/m68hc11/m68hc11.h (RETURN_POPS_ARGS): Likewise.
+       * config/mcore/mcore.h (RETURN_POPS_ARGS): Likewise.
+       * config/mep/mep.h (RETURN_POPS_ARGS): Likewise.
+       * config/mips/mips.h (RETURN_POPS_ARGS): Likewise.
+       * config/mmix/mmix.h (RETURN_POPS_ARGS): Likewise.
+       * config/mn10300/mn10300.h (RETURN_POPS_ARGS): Likewise.
+       * config/moxie/moxie.h (RETURN_POPS_ARGS): Likewise.
+       * config/pa/pa.h (RETURN_POPS_ARGS): Likewise.
+       * config/pdp11/pdp11.h (RETURN_POPS_ARGS): Likewise.
+       * config/picochip/picochip.h (RETURN_POPS_ARGS): Likewise.
+       * config/rs6000/rs6000.h (RETURN_POPS_ARGS): Likewise.
+       * config/rx/rx.h (RETURN_POPS_ARGS): Likewise.
+       * config/s390/s390.h (RETURN_POPS_ARGS): Likewise.
+       * config/score/score.h (RETURN_POPS_ARGS): Likewise.
+       * config/sh/sh.h (RETURN_POPS_ARGS): Likewise.
+       * config/sparc/sparc.h (RETURN_POPS_ARGS): Likewise.
+       * config/spu/spu.h (RETURN_POPS_ARGS): Likewise.
+       * config/stormy16/stormy16.h (RETURN_POPS_ARGS): Likewise.
+       * config/v850/v850.h (RETURN_POPS_ARGS): Likewise.
+       * config/xtensa/xtensa.h (RETURN_POPS_ARGS): Likewise.
+       * config/i386/i386-protos.h (ix86_return_pops_args): Delete.
+       * config/i386/i386.h (RETURN_POPS_ARGS): Delete.
+       * config/i386/i386.c (ix86_return_pops_args): Make static.
+       Constify arguments.
+       (TARGET_RETURN_POPS_ARGS): Define.
+       * config/m68k/m68k.h (RETURN_POPS_ARGS): Move to...
+       * config/m68k/m68k.c (m68k_return_pops_args): ...here.  New function.
+       (TARGET_RETURN_POPS_ARGS): Define.
+       * config/vax/vax.h (RETURN_POPS_ARGS): Move to...
+       * config/vax/vax.c (vax_return_pops_args): ...here.  New function.
+       (TARGET_RETURN_POPS_ARGS): Define.
+
 2010-06-29  Richard Guenther  <rguenther@suse.de>
 
        PR middle-end/44667
index 9c51f1a5a74e9b66f58c856e0455e9258dabea78..c6d4706733ad416775036571e7d3802eefc268b7 100644 (file)
@@ -208,13 +208,15 @@ prepare_call_address (tree fndecl, rtx funexp, rtx static_chain_value,
    The CALL_INSN is the first insn generated.
 
    FNDECL is the declaration node of the function.  This is given to the
-   macro RETURN_POPS_ARGS to determine whether this function pops its own args.
+   hook TARGET_RETURN_POPS_ARGS to determine whether this function pops
+   its own args.
 
-   FUNTYPE is the data type of the function.  This is given to the macro
-   RETURN_POPS_ARGS to determine whether this function pops its own args.
-   We used to allow an identifier for library functions, but that doesn't
-   work when the return type is an aggregate type and the calling convention
-   says that the pointer to this aggregate is to be popped by the callee.
+   FUNTYPE is the data type of the function.  This is given to the hook
+   TARGET_RETURN_POPS_ARGS to determine whether this function pops its
+   own args.  We used to allow an identifier for library functions, but
+   that doesn't work when the return type is an aggregate type and the
+   calling convention says that the pointer to this aggregate is to be
+   popped by the callee.
 
    STACK_SIZE is the number of bytes of arguments on the stack,
    ROUNDED_STACK_SIZE is that number rounded up to
@@ -256,7 +258,8 @@ emit_call_1 (rtx funexp, tree fntree ATTRIBUTE_UNUSED, tree fndecl ATTRIBUTE_UNU
   rtx rounded_stack_size_rtx = GEN_INT (rounded_stack_size);
   rtx call_insn;
   int already_popped = 0;
-  HOST_WIDE_INT n_popped = RETURN_POPS_ARGS (fndecl, funtype, stack_size);
+  HOST_WIDE_INT n_popped
+    = targetm.calls.return_pops_args (fndecl, funtype, stack_size);
 
 #ifdef CALL_POPS_ARGS
   n_popped += CALL_POPS_ARGS (* args_so_far);
@@ -2323,10 +2326,10 @@ expand_call (tree exp, rtx target, int ignore)
                               - crtl->args.pretend_args_size)
       /* If the callee pops its own arguments, then it must pop exactly
         the same number of arguments as the current function.  */
-      || (RETURN_POPS_ARGS (fndecl, funtype, args_size.constant)
-         != RETURN_POPS_ARGS (current_function_decl,
-                              TREE_TYPE (current_function_decl),
-                              crtl->args.size))
+      || (targetm.calls.return_pops_args (fndecl, funtype, args_size.constant)
+         != targetm.calls.return_pops_args (current_function_decl,
+                                            TREE_TYPE (current_function_decl),
+                                            crtl->args.size))
       || !lang_hooks.decls.ok_for_sibcall (fndecl))
     try_tail_call = 0;
 
index 8849697bfcebeb2b8c34c6ccfe97adcb83ef0c21..96bfb3a633e193c7dfd5ae3911cfffcbebff6ec0 100644 (file)
@@ -555,7 +555,7 @@ rest_of_handle_stack_adjustments (void)
   cleanup_cfg (flag_crossjumping ? CLEANUP_CROSSJUMP : 0);
 
   /* This is kind of a heuristic.  We need to run combine_stack_adjustments
-     even for machines with possibly nonzero RETURN_POPS_ARGS
+     even for machines with possibly nonzero TARGET_RETURN_POPS_ARGS
      and ACCUMULATE_OUTGOING_ARGS.  We expect that only ports having
      push instructions will have popping returns.  */
 #ifndef PUSH_ROUNDING
index 6235d9ff90af47ebb3eed6674a2e8d091b181368..c8590b9c782c931c9e4aad4161b1d6c8f1f405c1 100644 (file)
@@ -703,15 +703,6 @@ extern int alpha_memory_latency;
    in a register.  */
 /* #define REG_PARM_STACK_SPACE */
 
-/* Value is the number of bytes of arguments automatically
-   popped when returning from a subroutine call.
-   FUNDECL is the declaration node of the function (as a tree),
-   FUNTYPE is the data type of the function (as a tree),
-   or for a library call it is an identifier node for the subroutine name.
-   SIZE is the number of bytes of arguments passed on the stack.  */
-
-#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) 0
-
 /* Define how to find the value returned by a function.
    VALTYPE is the data type of the value (as a tree).
    If the precise function being called is known, FUNC is its FUNCTION_DECL;
index 5127a123e31ccc70f6c2b81fbdd0fa80c41742bf..9a4e360504b12df7cb4ddf9827810d1b0051feaa 100644 (file)
@@ -530,14 +530,6 @@ extern enum reg_class arc_regno_reg_class[FIRST_PSEUDO_REGISTER];
    increase the stack frame size by this amount.  */
 #define ACCUMULATE_OUTGOING_ARGS 1
 
-/* Value is the number of bytes of arguments automatically
-   popped when returning from a subroutine call.
-   FUNDECL is the declaration node of the function (as a tree),
-   FUNTYPE is the data type of the function (as a tree),
-   or for a library call it is an identifier node for the subroutine name.
-   SIZE is the number of bytes of arguments passed on the stack.  */
-#define RETURN_POPS_ARGS(DECL, FUNTYPE, SIZE) 0
-
 /* Define a data type for recording info about an argument list
    during the scan of that argument list.  This data type should
    hold all necessary information about the function itself
index 9066bbefb6108308c8f303b47c5192ccc18924d6..fcd1ef3d2ebe63c141e432227f4a34cfce7445f1 100644 (file)
@@ -1498,17 +1498,6 @@ do {                                                                           \
 /* Offset of first parameter from the argument pointer register value.  */
 #define FIRST_PARM_OFFSET(FNDECL)  (TARGET_ARM ? 4 : 0)
 
-/* Value is the number of byte of arguments automatically
-   popped when returning from a subroutine call.
-   FUNDECL is the declaration node of the function (as a tree),
-   FUNTYPE is the data type of the function (as a tree),
-   or for a library call it is an identifier node for the subroutine name.
-   SIZE is the number of bytes of arguments passed on the stack.
-
-   On the ARM, the caller does not pop any of its arguments that were passed
-   on the stack.  */
-#define RETURN_POPS_ARGS(FUNDECL, FUNTYPE, SIZE)  0
-
 /* Define how to find the value returned by a library function
    assuming the value has mode MODE.  */
 #define LIBCALL_VALUE(MODE)                                            \
index 398b412dd911a5821a337c14a31f73b8e12ad6c4..32ff27eedf443c72a1ae85f20ac61bfd0b522c43 100644 (file)
@@ -376,8 +376,6 @@ enum reg_class {
    for POST_DEC targets (PR27386).  */
 /*#define PUSH_ROUNDING(NPUSHED) (NPUSHED)*/
 
-#define RETURN_POPS_ARGS(FUNDECL, FUNTYPE, STACK_SIZE) 0
-
 #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) (function_arg (&(CUM), MODE, TYPE, NAMED))
 
 typedef struct avr_args {
index a1bd556003e98f7ba83ff2d68932681d9de5260b..367cd96dbc8e4db02832bb699fe05907131fbc83 100644 (file)
@@ -871,8 +871,6 @@ typedef struct {
 #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED)   \
   (function_arg_advance (&CUM, MODE, TYPE, NAMED))
 
-#define RETURN_POPS_ARGS(FDECL, FUNTYPE, STKSIZE) 0
-
 /* Define how to find the value returned by a function.
    VALTYPE is the data type of the value (as a tree).
    If the precise function being called is known, FUNC is its FUNCTION_DECL;
index ae2bfee4757c112fcfd0d13a2ec7b3259edcf2ba..4c685489a8c34cc9528720aff9fbf4dd944a9932 100644 (file)
@@ -859,8 +859,6 @@ enum reg_class
 
 #define ACCUMULATE_OUTGOING_ARGS 1
 
-#define RETURN_POPS_ARGS(FUNDECL, FUNTYPE, STACKSIZE) 0
-
 
 /* Node: Register Arguments */
 
index 1d5cb87af3e417fb19572e7842832890aa30d0b5..a6260f48aa253efa608c686ea52d5881d65fa303 100644 (file)
@@ -313,8 +313,6 @@ enum reg_class
 
 #define PUSH_ROUNDING(BYTES) (((BYTES) + 3) & ~3)
 
-#define RETURN_POPS_ARGS(FNDECL, FUNTYPE, SIZE)   0
-
 #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
   ((rtx) crx_function_arg(&(CUM), (MODE), (TYPE), (NAMED)))
 
index 5e6237895b53059785f657d82ce674deb5f9106a..ed675b16e6a0526d17eab61cd95cf01e0056672a 100644 (file)
@@ -568,41 +568,6 @@ enum reg_class
    proper.  */
 #define ACCUMULATE_OUTGOING_ARGS 1
 
-/* A C expression that should indicate the number of bytes of its own arguments
-   that a function pops on returning, or 0 if the function pops no arguments
-   and the caller must therefore pop them all after the function returns.
-
-   FUNDECL is a C variable whose value is a tree node that describes the
-   function in question.  Normally it is a node of type `FUNCTION_DECL' that
-   describes the declaration of the function.  From this it is possible to
-   obtain the DECL_ATTRIBUTES of the function.
-
-   FUNTYPE is a C variable whose value is a tree node that describes the
-   function in question.  Normally it is a node of type `FUNCTION_TYPE' that
-   describes the data type of the function.  From this it is possible to obtain
-   the data types of the value and arguments (if known).
-
-   When a call to a library function is being considered, FUNTYPE will contain
-   an identifier node for the library function.  Thus, if you need to
-   distinguish among various library functions, you can do so by their names.
-   Note that "library function" in this context means a function used to
-   perform arithmetic, whose name is known specially in the compiler and was
-   not mentioned in the C code being compiled.
-
-   STACK-SIZE is the number of bytes of arguments passed on the stack.  If a
-   variable number of bytes is passed, it is zero, and argument popping will
-   always be the responsibility of the calling function.
-
-   On the VAX, all functions always pop their arguments, so the definition of
-   this macro is STACK-SIZE.  On the 68000, using the standard calling
-   convention, no functions pop their arguments, so the value of the macro is
-   always 0 in this case.  But an alternative calling convention is available
-   in which functions that take a fixed number of arguments pop them but other
-   functions (such as `printf') pop nothing (the caller pops all).  When this
-   convention is in use, FUNTYPE is examined to determine whether a function
-   takes a fixed number of arguments.  */
-#define RETURN_POPS_ARGS(FUNDECL, FUNTYPE, STACK_SIZE) 0
-
 /*}}}*/ \f
 /*{{{  Function Arguments in Registers.  */ 
 
index 1bf8b6bb080b30aac6a856cb3b7d7839fc5c2209..56db4e4a21efdbef62ef1a254a1e8c42cd0ff47a 100644 (file)
@@ -1614,41 +1614,6 @@ typedef struct frv_stack {
    proper.  */
 #define ACCUMULATE_OUTGOING_ARGS 1
 
-/* A C expression that should indicate the number of bytes of its own arguments
-   that a function pops on returning, or 0 if the function pops no arguments
-   and the caller must therefore pop them all after the function returns.
-
-   FUNDECL is a C variable whose value is a tree node that describes the
-   function in question.  Normally it is a node of type `FUNCTION_DECL' that
-   describes the declaration of the function.  From this it is possible to
-   obtain the DECL_ATTRIBUTES of the function.
-
-   FUNTYPE is a C variable whose value is a tree node that describes the
-   function in question.  Normally it is a node of type `FUNCTION_TYPE' that
-   describes the data type of the function.  From this it is possible to obtain
-   the data types of the value and arguments (if known).
-
-   When a call to a library function is being considered, FUNTYPE will contain
-   an identifier node for the library function.  Thus, if you need to
-   distinguish among various library functions, you can do so by their names.
-   Note that "library function" in this context means a function used to
-   perform arithmetic, whose name is known specially in the compiler and was
-   not mentioned in the C code being compiled.
-
-   STACK-SIZE is the number of bytes of arguments passed on the stack.  If a
-   variable number of bytes is passed, it is zero, and argument popping will
-   always be the responsibility of the calling function.
-
-   On the VAX, all functions always pop their arguments, so the definition of
-   this macro is STACK-SIZE.  On the 68000, using the standard calling
-   convention, no functions pop their arguments, so the value of the macro is
-   always 0 in this case.  But an alternative calling convention is available
-   in which functions that take a fixed number of arguments pop them but other
-   functions (such as `printf') pop nothing (the caller pops all).  When this
-   convention is in use, FUNTYPE is examined to determine whether a function
-   takes a fixed number of arguments.  */
-#define RETURN_POPS_ARGS(FUNDECL, FUNTYPE, STACK_SIZE) 0
-
 \f
 /* The number of register assigned to holding function arguments.  */
 
index 1ce1585544efc1fdafc67bbad177bcfb16f264d4..4e0a3b6728e42b637a3bb2cb01b08dbf26a34194 100644 (file)
@@ -536,17 +536,6 @@ enum reg_class {
 
 #define FIRST_PARM_OFFSET(FNDECL) 0
 
-/* Value is the number of bytes of arguments automatically
-   popped when returning from a subroutine call.
-   FUNDECL is the declaration node of the function (as a tree),
-   FUNTYPE is the data type of the function (as a tree),
-   or for a library call it is an identifier node for the subroutine name.
-   SIZE is the number of bytes of arguments passed on the stack.
-
-   On the H8 the return does not pop anything.  */
-
-#define RETURN_POPS_ARGS(FUNDECL, FUNTYPE, SIZE) 0
-
 /* Definitions for register eliminations.
 
    This is an array of structures.  Each structure initializes one pair
index 308f9eef5e830ee8e559b094b35d00014b0d7ffe..f3facb3598ff949206bb73d8bd6cbe7f85225a3e 100644 (file)
@@ -188,8 +188,6 @@ extern void function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode,
 #endif /* RTX_CODE  */
 
 #ifdef TREE_CODE
-extern int ix86_return_pops_args (tree, tree, int);
-
 extern int ix86_data_alignment (tree, int);
 extern unsigned int ix86_local_alignment (tree, enum machine_mode,
                                          unsigned int);
index bd1cc05cfbd39fbe31900414a5fd20bef03786b5..39308db43322c9318e512fb3e5b261c28f69f3ea 100644 (file)
@@ -4865,7 +4865,7 @@ ix86_eax_live_at_start_p (void)
 
    The attribute stdcall is equivalent to RTD on a per module basis.  */
 
-int
+static int
 ix86_return_pops_args (tree fundecl, tree funtype, int size)
 {
   int rtd;
@@ -30888,6 +30888,8 @@ ix86_enum_va_list (int idx, const char **pname, tree *ptree)
 #define TARGET_STATIC_CHAIN ix86_static_chain
 #undef TARGET_TRAMPOLINE_INIT
 #define TARGET_TRAMPOLINE_INIT ix86_trampoline_init
+#undef TARGET_RETURN_POPS_ARGS
+#define TARGET_RETURN_POPS_ARGS ix86_return_pops_args
 
 #undef TARGET_GIMPLIFY_VA_ARG_EXPR
 #define TARGET_GIMPLIFY_VA_ARG_EXPR ix86_gimplify_va_arg
index 67f1f60f3a1873860484553af4a7ae2e3deb3fdf..05adfc5894ea4b1d75dda6545a075efc8f159d5b 100644 (file)
@@ -1542,26 +1542,6 @@ enum reg_class
 #define OUTGOING_REG_PARM_STACK_SPACE(FNTYPE) \
   (ix86_function_type_abi (FNTYPE) == MS_ABI)
 
-/* Value is the number of bytes of arguments automatically
-   popped when returning from a subroutine call.
-   FUNDECL is the declaration node of the function (as a tree),
-   FUNTYPE is the data type of the function (as a tree),
-   or for a library call it is an identifier node for the subroutine name.
-   SIZE is the number of bytes of arguments passed on the stack.
-
-   On the 80386, the RTD insn may be used to pop them if the number
-     of args is fixed, but if the number is variable then the caller
-     must pop them all.  RTD can't be used for library calls now
-     because the library is compiled with the Unix compiler.
-   Use of RTD is a selectable option, since it is incompatible with
-   standard Unix calling sequences.  If the option is not selected,
-   the caller must always pop the args.
-
-   The attribute stdcall is equivalent to RTD on a per module basis.  */
-
-#define RETURN_POPS_ARGS(FUNDECL, FUNTYPE, SIZE) \
-  ix86_return_pops_args ((FUNDECL), (FUNTYPE), (SIZE))
-
 /* Define how to find the value returned by a library function
    assuming the value has mode MODE.  */
 
index bf24f73f04e63d64555dafbc0f20f332ebc25cc1..d3821f6c6f415556c355ca5e1a87f37f76fe1b8e 100644 (file)
@@ -1042,12 +1042,6 @@ enum reg_class
 
 #define ACCUMULATE_OUTGOING_ARGS 1
 
-/* A C expression that should indicate the number of bytes of its own arguments
-   that a function pops on returning, or 0 if the function pops no arguments
-   and the caller must therefore pop them all after the function returns.  */
-
-#define RETURN_POPS_ARGS(FUNDECL, FUNTYPE, STACK_SIZE) 0
-
 \f
 /* Function Arguments in Registers */
 
index 53a6b5cad04660d6d6f1a72ba6597acf644f031f..07d4c2d864b0e0744fdd8df9f09fc6371c248c0b 100644 (file)
@@ -365,8 +365,6 @@ enum reg_class
 
 #define OUTGOING_REG_PARM_STACK_SPACE(FNTYPE) 1
 
-#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) 0
-
 \f
 /* Function Arguments in Registers.  */
 
index 3a81457672261af3343296d675997217d9c7a3a6..0bf37455627b46d6cf1a8c433e5af7ed87d3dc23 100644 (file)
@@ -273,8 +273,6 @@ enum reg_class
 
 #define ACCUMULATE_OUTGOING_ARGS 1
 
-#define RETURN_POPS_ARGS(DECL, FUNTYPE, SIZE) 0
-
 /*--------------------------------*/
 /* Passing Arguments in Registers */
 /*--------------------------------*/
index a98005c78c1e9442d30bd4a4bfa6f0ca4e01062c..8f7b720c696a80319e84dd3745c736495c3d33da 100644 (file)
@@ -503,7 +503,6 @@ enum reg_class
 
 #define PUSH_ARGS 1
 #define PUSH_ROUNDING(N) m32c_push_rounding (N)
-#define RETURN_POPS_ARGS(D,T,S) 0
 #define CALL_POPS_ARGS(C) 0
 
 /* Passing Arguments in Registers */
index 28d06a4b23cc312c9a9c6e3f1b72f8a521f84a7d..91d055bcb5bef3f6caf616c667e7fbdd691c369e 100644 (file)
@@ -823,14 +823,6 @@ extern enum reg_class m32r_regno_reg_class[FIRST_PSEUDO_REGISTER];
    increase the stack frame size by this amount.  */
 #define ACCUMULATE_OUTGOING_ARGS 1
 
-/* Value is the number of bytes of arguments automatically
-   popped when returning from a subroutine call.
-   FUNDECL is the declaration node of the function (as a tree),
-   FUNTYPE is the data type of the function (as a tree),
-   or for a library call it is an identifier node for the subroutine name.
-   SIZE is the number of bytes of arguments passed on the stack.  */
-#define RETURN_POPS_ARGS(DECL, FUNTYPE, SIZE) 0
-
 /* Define a data type for recording info about an argument list
    during the scan of that argument list.  This data type should
    hold all necessary information about the function itself
index aef48a6e89432254ffe3d6c6c555209838bb09bb..2ea80a763968c4536dd4e3c4f308d10cc5d7c8f8 100644 (file)
@@ -896,15 +896,6 @@ extern enum reg_class m68hc11_tmp_regs_class;
    stack pointer really advances by. No rounding or alignment needed
    for MC6811.  */
 #define PUSH_ROUNDING(BYTES)   (BYTES)
-
-/* Value is 1 if returning from a function call automatically pops the
-   arguments described by the number-of-args field in the call. FUNTYPE is
-   the data type of the function (as a tree), or for a library call it is
-   an identifier node for the subroutine name.
-  
-   The standard MC6811 call, with arg count word, includes popping the
-   args as part of the call template.  */
-#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) 0
 \f
 /* Passing Arguments in Registers.  */
 
index 0ca5cd1d12a1fa3c211d04bc5a7f9957640af543..529266ca23f6162fa8c2f3233d85c413fa78627f 100644 (file)
@@ -153,6 +153,7 @@ static bool m68k_return_in_memory (const_tree, const_tree);
 #endif
 static void m68k_output_dwarf_dtprel (FILE *, int, rtx) ATTRIBUTE_UNUSED;
 static void m68k_trampoline_init (rtx, tree, rtx);
+static int m68k_return_pops_args (tree, tree, int);
 static rtx m68k_delegitimize_address (rtx);
 \f
 
@@ -271,6 +272,9 @@ const char *m68k_library_id_string = "_current_shared_library_a5_offset_";
 #undef TARGET_TRAMPOLINE_INIT
 #define TARGET_TRAMPOLINE_INIT m68k_trampoline_init
 
+#undef TARGET_RETURN_POPS_ARGS
+#define TARGET_RETURN_POPS_ARGS m68k_return_pops_args
+
 #undef TARGET_DELEGITIMIZE_ADDRESS
 #define TARGET_DELEGITIMIZE_ADDRESS m68k_delegitimize_address
 
@@ -6520,4 +6524,25 @@ m68k_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value)
   FINALIZE_TRAMPOLINE (XEXP (m_tramp, 0));
 }
 
+/* On the 68000, the RTS insn cannot pop anything.
+   On the 68010, the RTD insn may be used to pop them if the number
+     of args is fixed, but if the number is variable then the caller
+     must pop them all.  RTD can't be used for library calls now
+     because the library is compiled with the Unix compiler.
+   Use of RTD is a selectable option, since it is incompatible with
+   standard Unix calling sequences.  If the option is not selected,
+   the caller must always pop the args.  */
+
+static int
+m68k_return_pops_args (tree fundecl, tree funtype, int size)
+{
+  return ((TARGET_RTD
+          && (!fundecl
+              || TREE_CODE (fundecl) != IDENTIFIER_NODE)
+          && (TYPE_ARG_TYPES (funtype) == 0
+              || (TREE_VALUE (tree_last (TYPE_ARG_TYPES (funtype)))
+                  == void_type_node)))
+         ? size : 0);
+}
+
 #include "gt-m68k.h"
index 5787e8aa1fdd0323a1a80e6ffaf567cc29eb578c..ac478619f73ee67b557fec22d535895fabc1d00a 100644 (file)
@@ -534,21 +534,6 @@ extern enum reg_class regno_reg_class[];
 
 #define FIRST_PARM_OFFSET(FNDECL) 8
 
-/* On the 68000, the RTS insn cannot pop anything.
-   On the 68010, the RTD insn may be used to pop them if the number
-     of args is fixed, but if the number is variable then the caller
-     must pop them all.  RTD can't be used for library calls now
-     because the library is compiled with the Unix compiler.
-   Use of RTD is a selectable option, since it is incompatible with
-   standard Unix calling sequences.  If the option is not selected,
-   the caller must always pop the args.  */
-#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE)   \
-  ((TARGET_RTD && (!(FUNDECL) || TREE_CODE (FUNDECL) != IDENTIFIER_NODE)       \
-    && (TYPE_ARG_TYPES (FUNTYPE) == 0                          \
-       || (TREE_VALUE (tree_last (TYPE_ARG_TYPES (FUNTYPE)))   \
-           == void_type_node)))                                \
-   ? (SIZE) : 0)
-
 /* On the m68k the return value defaults to D0.  */
 #define FUNCTION_VALUE(VALTYPE, FUNC)  \
   gen_rtx_REG (TYPE_MODE (VALTYPE), D0_REG)
index 4f0ef1d7d6bfb098281c5a2d964bfe225d5f02bb..7421d5dbb85fc87029a050624494e96db824c773 100644 (file)
@@ -540,16 +540,6 @@ extern const enum reg_class reg_class_from_letter[];
 /* Offset of first parameter from the argument pointer register value.  */
 #define FIRST_PARM_OFFSET(FNDECL)  0
 
-/* Value is the number of byte of arguments automatically
-   popped when returning from a subroutine call.
-   FUNTYPE is the data type of the function (as a tree),
-   or for a library call it is an identifier node for the subroutine name.
-   SIZE is the number of bytes of arguments passed on the stack.
-
-   On the MCore, the callee does not pop any of its arguments that were passed
-   on the stack.  */
-#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) 0
-
 /* Define how to find the value returned by a function.
    VALTYPE is the data type of the value (as a tree).
    If the precise function being called is known, FUNC is its FUNCTION_DECL;
index 9d286e33b94fa034a5cb4bd73f7b456dc5974284..d3af07349510f8fc8ff7c92d70af04470fd50818 100644 (file)
@@ -503,8 +503,6 @@ extern unsigned int mep_selected_isa;
 
 #define ACCUMULATE_OUTGOING_ARGS 1
 
-#define RETURN_POPS_ARGS(FUNDECL, FUNTYPE, STACK_SIZE) 0
-
 \f
 
 /* The ABI is thus: Arguments are in $1, $2, $3, $4, stack.  Arguments
index 4026bd737140397b967448e1351978dc6d48e9e9..ea79eba25500874641a3dd6499d5b3bfa4ac0e06 100644 (file)
@@ -2162,8 +2162,6 @@ enum reg_class
 
 #define STACK_BOUNDARY (TARGET_NEWABI ? 128 : 64)
 \f
-#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) 0
-
 /* Symbolic macros for the registers used to return integer and floating
    point values.  */
 
index 2886443c66da7018116c3e17f69ac7bc2f054fa3..48551028d5bbf8d024b7379ea5ddc08590fd4f2b 100644 (file)
@@ -586,8 +586,6 @@ enum reg_class
 
 #define ACCUMULATE_OUTGOING_ARGS 1
 
-#define RETURN_POPS_ARGS(FUNDECL, FUNTYPE, STACKSIZE) 0
-
 
 /* Node: Register Arguments */
 #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED)   \
index 12e7861201430d87937490b068d79cd9c7a97936..1700f1a25be583d92cfb0c2f6b0e8fd3fdd6fc8f 100644 (file)
@@ -492,15 +492,6 @@ enum reg_class {
    them whenever possible.  */
 #define CAN_DEBUG_WITHOUT_FP
 
-/* Value is the number of bytes of arguments automatically
-   popped when returning from a subroutine call.
-   FUNDECL is the declaration node of the function (as a tree),
-   FUNTYPE is the data type of the function (as a tree),
-   or for a library call it is an identifier node for the subroutine name.
-   SIZE is the number of bytes of arguments passed on the stack.  */
-
-#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) 0
-
 /* We use d0/d1 for passing parameters, so allocate 8 bytes of space
    for a register flushback area.  */
 #define REG_PARM_STACK_SPACE(DECL) 8
index 266a244c570faa72f8d23c63cdb29ede94cf8f68..0a53b6b72165c9dd487ffd14e07672e265c5d2c8 100644 (file)
@@ -453,8 +453,6 @@ enum reg_class
 /* All load operations zero extend.  */
 #define LOAD_EXTEND_OP(MEM) ZERO_EXTEND
 
-#define RETURN_POPS_ARGS(FUNDECL, FUNTYPE, STACK_SIZE) 0
-
 /* A C expression that is nonzero if X is a legitimate constant for
    an immediate operand on the target machine.  */
 #define LEGITIMATE_CONSTANT_P(X) 1
index 8a18289b0d2ba96470890da490fa1ea4e82db8a1..4eae700b0777d5065abd7b4ba461806934808874 100644 (file)
@@ -553,14 +553,6 @@ extern struct rtx_def *hppa_pic_save_rtx (void);
    ? (STACK_POINTER_OFFSET)            \
    : ((STACK_POINTER_OFFSET) - crtl->outgoing_args_size))
 
-/* Value is 1 if returning from a function call automatically
-   pops the arguments described by the number-of-args field in the call.
-   FUNDECL is the declaration node of the function (as a tree),
-   FUNTYPE is the data type of the function (as a tree),
-   or for a library call it is an identifier node for the subroutine name.  */
-
-#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) 0
-
 /* Define how to find the value returned by a library function
    assuming the value has mode MODE.  */
 
index 15eef844a340ff2e451564ebfbdbcd07d4d248ba..006fb4cbd86587a6fd75fb9b835269e254d5d6eb 100644 (file)
@@ -435,14 +435,6 @@ extern int current_first_parm_offset;
 */
 #define FIRST_PARM_OFFSET(FNDECL) 4
 
-/* Value is 1 if returning from a function call automatically
-   pops the arguments described by the number-of-args field in the call.
-   FUNDECL is the declaration node of the function (as a tree),
-   FUNTYPE is the data type of the function (as a tree),
-   or for a library call it is an identifier node for the subroutine name.  */
-
-#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) 0
-
 /* Define how to find the value returned by a function.
    VALTYPE is the data type of the value (as a tree).
    If the precise function being called is known, FUNC is its FUNCTION_DECL;
index 7269fa062ad057a165760f292d92774a2b28fca8..b4aec727df561ad91db7f8cac3f16361acf0a86c 100644 (file)
@@ -406,9 +406,6 @@ extern const enum reg_class picochip_regno_reg_class[FIRST_PSEUDO_REGISTER];
 
 #define PUSH_ARGS 0
 
-/* Functions don't pop their args.  */
-#define RETURN_POPS_ARGS(FNDECL, FNTYPE, STACK) 0
-
 /* Passing Arguments in Registers  */
 
 /* Store the offset of the next argument. */
index 3f37c4b48360cdd448cf6204e53ea3662e8a4f93..2ee3da182840e98bc8ee4278cc23f4972bb4c7f4 100644 (file)
@@ -1578,15 +1578,6 @@ extern enum rs6000_abi rs6000_current_abi;       /* available for use by subtarget */
    found in the variable crtl->outgoing_args_size.  */
 #define ACCUMULATE_OUTGOING_ARGS 1
 
-/* Value is the number of bytes of arguments automatically
-   popped when returning from a subroutine call.
-   FUNDECL is the declaration node of the function (as a tree),
-   FUNTYPE is the data type of the function (as a tree),
-   or for a library call it is an identifier node for the subroutine name.
-   SIZE is the number of bytes of arguments passed on the stack.  */
-
-#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) 0
-
 /* Define how to find the value returned by a library function
    assuming the value has mode MODE.  */
 
index cb63951108b2c2d28de3279fb65dd62c0c45bcfb..afaa07b0bc5bc92275a14a2ed67dd600d1b3beb2 100644 (file)
@@ -154,7 +154,6 @@ extern enum rx_cpu_types  rx_cpu_type;
 #define MOVE_MAX                       4
 #define STARTING_FRAME_OFFSET          0
 
-#define RETURN_POPS_ARGS(FUNDECL, FUNTYPE, SIZE) 0
 #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC)   1
 
 #define LEGITIMATE_CONSTANT_P(X)       rx_is_legitimate_constant (X)
index 1d74d30c000e48d1068e255b629d268888c107c3..cbe28991c18261ec5580d680eb1d913e16356183 100644 (file)
@@ -673,9 +673,6 @@ extern const enum reg_class regclass_map[FIRST_PSEUDO_REGISTER];
 /* We need current_function_outgoing_args to be valid.  */
 #define ACCUMULATE_OUTGOING_ARGS 1
 
-/* Return doesn't modify the stack.  */
-#define RETURN_POPS_ARGS(FUNDECL, FUNTYPE, SIZE) 0
-
 
 /* Register arguments.  */
 
index cde9c22254606ed2155a67036164f58dd6d2dfe3..98ca0a3537bd8fab898ebbda5a68f458cfe22cb1 100644 (file)
@@ -581,8 +581,6 @@ extern enum reg_class score_char_to_class[256];
    `crtl->outgoing_args_size'.  */
 #define OUTGOING_REG_PARM_STACK_SPACE(FNTYPE) 1
 
-#define RETURN_POPS_ARGS(FUNDECL, FUNTYPE, STACK_SIZE) 0
-
 /* Passing Arguments in Registers  */
 /* Determine where to put an argument to a function.
    Value is zero to push the argument on the stack,
index 9482387ea56f7778b6ca72ca7bfc14c8325ff7e9..ee3e05995d6c640639d4e2b8431fc187214b5cb6 100644 (file)
@@ -1423,17 +1423,6 @@ extern enum reg_class regno_reg_class[FIRST_PSEUDO_REGISTER];
 /* Offset of first parameter from the argument pointer register value.  */
 #define FIRST_PARM_OFFSET(FNDECL)  0
 
-/* Value is the number of byte of arguments automatically
-   popped when returning from a subroutine call.
-   FUNDECL is the declaration node of the function (as a tree),
-   FUNTYPE is the data type of the function (as a tree),
-   or for a library call it is an identifier node for the subroutine name.
-   SIZE is the number of bytes of arguments passed on the stack.
-
-   On the SH, the caller does not pop any of its arguments that were passed
-   on the stack.  */
-#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE)  0
-
 /* Value is the number of bytes of arguments automatically popped when
    calling a subroutine.
    CUM is the accumulated argument list.
index 6c28e9838c8a59b71ba21a0af11bb17524e17c49..6f6aec7d3f9e520368d6a2c71b54166abfa65165 100644 (file)
@@ -1387,15 +1387,6 @@ extern char leaf_reg_remap[];
    the function!  */
 #define ACCUMULATE_OUTGOING_ARGS 1
 
-/* Value is the number of bytes of arguments automatically
-   popped when returning from a subroutine call.
-   FUNDECL is the declaration node of the function (as a tree),
-   FUNTYPE is the data type of the function (as a tree),
-   or for a library call it is an identifier node for the subroutine name.
-   SIZE is the number of bytes of arguments passed on the stack.  */
-
-#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) 0
-
 /* Define this macro if the target machine has "register windows".  This
    C expression returns the register number as seen by the called function
    corresponding to register number OUT as seen by the calling function.
index 54b461235a7b3ab2b91673560151db6ec037f2e1..d3880418c2f151fb0e3d349df91edbccff114e51 100644 (file)
@@ -334,8 +334,6 @@ targetm.resolve_overloaded_builtin = spu_resolve_overloaded_builtin;        \
 
 #define OUTGOING_REG_PARM_STACK_SPACE(FNTYPE) 1
 
-#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) (0)
-
 \f
 /* Register Arguments */
 
index cf6acf586c237f5e7af724b90d2e150891cf871e..4ea89a218dbc75bc6fa7d28c54852509c7d46933 100644 (file)
@@ -328,8 +328,6 @@ enum reg_class
 
 #define PUSH_ROUNDING(BYTES) (((BYTES) + 1) & ~1)
 
-#define RETURN_POPS_ARGS(FUNDECL, FUNTYPE, STACK_SIZE) 0
-
 \f
 /* Function Arguments in Registers.  */
 
index 4c4c270db71cb070fe0774b842babf403c2221e8..25faff1e7ddd0b8bbe1e3454e9040d45ae3bfad2 100644 (file)
@@ -556,15 +556,6 @@ enum reg_class
 /* Keep the stack pointer constant throughout the function.  */
 #define ACCUMULATE_OUTGOING_ARGS 1
 
-/* Value is the number of bytes of arguments automatically
-   popped when returning from a subroutine call.
-   FUNDECL is the declaration node of the function (as a tree),
-   FUNTYPE is the data type of the function (as a tree),
-   or for a library call it is an identifier node for the subroutine name.
-   SIZE is the number of bytes of arguments passed on the stack.  */
-
-#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) 0
-
 #define RETURN_ADDR_RTX(COUNT, FP) v850_return_addr (COUNT)
 \f
 /* Define a data type for recording info about an argument list
index 5d547fee8d5297ced4a035ec99293dbe76e63636..b3dfcb1e0798b065b35b267b01858a6ffe281b10 100644 (file)
@@ -58,6 +58,7 @@ static rtx vax_struct_value_rtx (tree, int);
 static rtx vax_builtin_setjmp_frame_value (void);
 static void vax_asm_trampoline_template (FILE *);
 static void vax_trampoline_init (rtx, tree, rtx);
+static int vax_return_pops_args (tree, tree, int);
 \f
 /* Initialize the GCC target structure.  */
 #undef TARGET_ASM_ALIGNED_HI_OP
@@ -106,6 +107,8 @@ static void vax_trampoline_init (rtx, tree, rtx);
 #define TARGET_ASM_TRAMPOLINE_TEMPLATE vax_asm_trampoline_template
 #undef TARGET_TRAMPOLINE_INIT
 #define TARGET_TRAMPOLINE_INIT vax_trampoline_init
+#undef TARGET_RETURN_POPS_ARGS
+#define TARGET_RETURN_POPS_ARGS vax_return_pops_args
 
 struct gcc_target targetm = TARGET_INITIALIZER;
 \f
@@ -2068,3 +2071,18 @@ vax_trampoline_init (rtx m_tramp, tree fndecl, rtx cxt)
   emit_insn (gen_sync_istream ());
 }
 
+/* Value is the number of bytes of arguments automatically
+   popped when returning from a subroutine call.
+   FUNDECL is the declaration node of the function (as a tree),
+   FUNTYPE is the data type of the function (as a tree),
+   or for a library call it is an identifier node for the subroutine name.
+   SIZE is the number of bytes of arguments passed on the stack.
+
+   On the VAX, the RET insn pops a maximum of 255 args for any function.  */
+
+static int
+vax_return_pops_args (tree fundecl ATTRIBUTE_UNUSED,
+                     tree funtype ATTRIBUTE_UNUSED, int size)
+{
+  return size > 255 * 4 ? 0 : size;
+}
index e85ce01f82077e224068c78a0b3944862b53f8ff..88a8f1c9b1faa1de43137e981fe129ab6a3c206c 100644 (file)
@@ -305,18 +305,6 @@ enum reg_class { NO_REGS, ALL_REGS, LIM_REG_CLASSES };
 /* Offset of first parameter from the argument pointer register value.  */
 #define FIRST_PARM_OFFSET(FNDECL) 4
 
-/* Value is the number of bytes of arguments automatically
-   popped when returning from a subroutine call.
-   FUNDECL is the declaration node of the function (as a tree),
-   FUNTYPE is the data type of the function (as a tree),
-   or for a library call it is an identifier node for the subroutine name.
-   SIZE is the number of bytes of arguments passed on the stack.
-
-   On the VAX, the RET insn pops a maximum of 255 args for any function.  */
-
-#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) \
-  ((SIZE) > 255 * 4 ? 0 : (SIZE))
-
 /* Define how to find the value returned by a function.
    VALTYPE is the data type of the value (as a tree).
    If the precise function being called is known, FUNC is its FUNCTION_DECL;
index 80c296d930ffe58d24d53c6ceddada1fa1d12aa1..32819bc0de7848c0cb72848db1be649e4a4e4500 100644 (file)
@@ -547,9 +547,6 @@ extern const enum reg_class xtensa_regno_to_class[FIRST_PSEUDO_REGISTER];
    128-bit datatypes defined in TIE (e.g., for Vectra).  */
 #define STACK_BOUNDARY 128
 
-/* Functions do not pop arguments off the stack.  */
-#define RETURN_POPS_ARGS(FUNDECL, FUNTYPE, SIZE) 0
-
 /* Use a fixed register window size of 8.  */
 #define WINDOW_SIZE 8
 
index 637dd50444dc5a2a80baed44277a54531bb7ae28..81665c310aaa500a29d712d4f0cc4b0551a38df7 100644 (file)
@@ -3928,11 +3928,10 @@ suppresses this behavior and causes the parameter to be passed on the
 stack in its natural location.
 @end defmac
 
-@defmac RETURN_POPS_ARGS (@var{fundecl}, @var{funtype}, @var{stack-size})
-A C expression that should indicate the number of bytes of its own
-arguments that a function pops on returning, or 0 if the
-function pops no arguments and the caller must therefore pop them all
-after the function returns.
+@deftypefn {Target Hook} TARGET_RETURN_POPS_ARGS (@var{fundecl}, @var{funtype}, @var{stack-size})
+This target hook returns the number of bytes of its own arguments that
+a function pops on returning, or 0 if the function pops no arguments
+and the caller must therefore pop them all after the function returns.
 
 @var{fundecl} is a C variable whose value is a tree node that describes
 the function in question.  Normally it is a node of type
@@ -3965,7 +3964,7 @@ arguments pop them but other functions (such as @code{printf}) pop
 nothing (the caller pops all).  When this convention is in use,
 @var{funtype} is examined to determine whether a function takes a fixed
 number of arguments.
-@end defmac
+@end deftypefn
 
 @defmac CALL_POPS_ARGS (@var{cum})
 A C expression that should indicate the number of bytes a call sequence
index 5c31955380ae4945936b8698b55853922ad7b686..f58d3d1b4e680a5465cc11171854c9b08c4b96ae 100644 (file)
@@ -3369,8 +3369,9 @@ assign_parms (tree fndecl)
   /* See how many bytes, if any, of its args a function should try to pop
      on return.  */
 
-  crtl->args.pops_args = RETURN_POPS_ARGS (fndecl, TREE_TYPE (fndecl),
-                                                crtl->args.size);
+  crtl->args.pops_args = targetm.calls.return_pops_args (fndecl,
+                                                        TREE_TYPE (fndecl),
+                                                        crtl->args.size);
 
   /* For stdarg.h function, save info about
      regs and stack space used by the named args.  */
index b868c37fda8aae251e57c749af1de5b80442dae9..bf2d8025b3c2adf765f9fee0f7a608093ef671c5 100644 (file)
@@ -530,11 +530,12 @@ init_reg_sets_1 (void)
       /* There are a couple of fixed registers that we know are safe to
         exclude from being clobbered by calls:
 
-        The frame pointer is always preserved across calls.  The arg pointer
-        is if it is fixed.  The stack pointer usually is, unless
-        RETURN_POPS_ARGS, in which case an explicit CLOBBER will be present.
-        If we are generating PIC code, the PIC offset table register is
-        preserved across calls, though the target can override that.  */
+        The frame pointer is always preserved across calls.  The arg
+        pointer is if it is fixed.  The stack pointer usually is,
+        unless TARGET_RETURN_POPS_ARGS, in which case an explicit
+        CLOBBER will be present.  If we are generating PIC code, the
+        PIC offset table register is preserved across calls, though the
+        target can override that.  */
 
       if (i == STACK_POINTER_REGNUM)
        ;
index af3dd3a64e7d863032bbfb1294345440e42e257c..dd72d07fa3df6c1ff26c27b8dfae03f01ca1bf42 100644 (file)
@@ -714,7 +714,8 @@ extern void fancy_abort (const char *, int, const char *) ATTRIBUTE_NORETURN;
        FUNCTION_ARG_PARTIAL_NREGS ASM_OUTPUT_DWARF_DTPREL              \
        ALLOCATE_INITIAL_VALUE LEGITIMIZE_ADDRESS FRAME_POINTER_REQUIRED \
        CAN_ELIMINATE TRAMPOLINE_TEMPLATE INITIALIZE_TRAMPOLINE         \
-       TRAMPOLINE_ADJUST_ADDRESS STATIC_CHAIN STATIC_CHAIN_INCOMING
+       TRAMPOLINE_ADJUST_ADDRESS STATIC_CHAIN STATIC_CHAIN_INCOMING    \
+       RETURN_POPS_ARGS
 
 /* Other obsolete target macros, or macros that used to be in target
    headers and were not used, and may be obsolete or may never have
index 27b7fa8e041dc1a9bcc6456edc30b6ae5deb2b0d..7342ba7715f5cf871920284e0f73bcad66291b17 100644 (file)
 #define TARGET_STATIC_CHAIN default_static_chain
 #define TARGET_TRAMPOLINE_INIT default_trampoline_init
 #define TARGET_TRAMPOLINE_ADJUST_ADDRESS NULL
+#define TARGET_RETURN_POPS_ARGS default_return_pops_args
 
 #define TARGET_CALLS {                                         \
    TARGET_PROMOTE_FUNCTION_MODE,                               \
    TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS,                       \
    TARGET_STATIC_CHAIN,                                                \
    TARGET_TRAMPOLINE_INIT,                                     \
-   TARGET_TRAMPOLINE_ADJUST_ADDRESS                            \
+   TARGET_TRAMPOLINE_ADJUST_ADDRESS,                           \
+   TARGET_RETURN_POPS_ARGS                                     \
    }
 
 #ifndef TARGET_UNWIND_TABLES_DEFAULT
index 5a857d7edf7cf2fcd0949bf4a4f1edd48ba5f89f..1d4ab4103f2a1cf47b3983b700ada05c77cdf6af 100644 (file)
@@ -1064,6 +1064,11 @@ struct gcc_target
 
     /* Adjust the address of the trampoline in a target-specific way.  */
     rtx (*trampoline_adjust_address) (rtx addr);
+
+    /* Return the number of bytes of its own arguments that a function
+       pops on returning, or 0 if the function pops no arguments and the
+       caller must therefore pop them all after the function returns.  */
+    int (*return_pops_args) (tree fundecl, tree funtype, int size);
   } calls;
 
   /* Return the diagnostic message string if conversion from FROMTYPE
index 62e357729bb203d37b5c428bed2f0d1c2668f187..b0ef5c6127ebc12418c12d25c58155728a462ae2 100644 (file)
@@ -756,6 +756,14 @@ default_trampoline_init (rtx ARG_UNUSED (m_tramp), tree ARG_UNUSED (t_func),
   sorry ("nested function trampolines not supported on this target");
 }
 
+int
+default_return_pops_args (tree fundecl ATTRIBUTE_UNUSED,
+                         tree funtype ATTRIBUTE_UNUSED,
+                         int size ATTRIBUTE_UNUSED)
+{
+  return 0;
+}
+
 enum reg_class
 default_branch_target_register_class (void)
 {
index fdd0e4a3c75ddf0d34efb64502826e9d5f317135..e24f85ecedef1f0613ddbefee4ecbcfc1705430c 100644 (file)
@@ -108,6 +108,7 @@ extern bool default_function_value_regno_p (const unsigned int);
 extern rtx default_internal_arg_pointer (void);
 extern rtx default_static_chain (const_tree, bool);
 extern void default_trampoline_init (rtx, tree, rtx);
+extern int default_return_pops_args (tree, tree, int);
 extern enum reg_class default_branch_target_register_class (void);
 #ifdef IRA_COVER_CLASSES
 extern const enum reg_class *default_ira_cover_classes (void);