This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFC: semi-automatic hookization


target.h and function.h include tm.h, and they got data structure dependencies
that are painful to untangle. function.h requires x_rtl to be split into
a target-type tainted part and one that can be used in tree optimizers / frontends
(via the inline functions in emit-rtl.c). To get rid of the tm.h include in
target.h we have to get rid of all the CUMULATIVE_ARG types in hook definitions.
Both changes require a lot of changes in config/arm to get arm-eabi back to building. And that's just one of 38 config/<architecture> directories.


If the CUMULATIVE_ARG typed hooks had been defined with a wrapper macro, it'd
be just a simple change in one place.  The way things are, it'll require
hundreds of changes throughout the config directory.

Before I go and make all these target changes & test them, is there at least agreemwent that this is the right approach, i.e replacing CUMULATIVE_ARG *
with void *, and splitting up x_rtl into two variables.


At least with the latter there is one clear alternative: we could have
non-inline accessor functions for the contents of x_rtl, and provide the inline versions in emit-rtl.h only for source files that include tm.h .That might slow
down the current tree-ssa users, though, e.g tree-ssa-loop-ivopts.c .


Index: doc/tm.texi
===================================================================
--- doc/tm.texi	(revision 166792)
+++ doc/tm.texi	(working copy)
@@ -4053,7 +4053,7 @@ @defmac FUNCTION_INCOMING_ARG (@var{cum}
 serves both purposes.
 @end defmac
 
-@deftypefn {Target Hook} int TARGET_ARG_PARTIAL_BYTES (CUMULATIVE_ARGS *@var{cum}, enum machine_mode @var{mode}, tree @var{type}, bool @var{named})
+@deftypefn {Target Hook} int TARGET_ARG_PARTIAL_BYTES ( void *@var{cum}, enum machine_mode @var{mode}, tree @var{type}, bool @var{named})
 This target hook returns the number of bytes at the beginning of an
 argument that must be put in registers.  The value must be zero for
 arguments that are passed entirely in registers or that are entirely
@@ -4072,7 +4072,7 @@ structure) crosses that boundary, its fi
 @code{FUNCTION_INCOMING_ARG}, for the called function.
 @end deftypefn
 
-@deftypefn {Target Hook} bool TARGET_PASS_BY_REFERENCE (CUMULATIVE_ARGS *@var{cum}, enum machine_mode @var{mode}, const_tree @var{type}, bool @var{named})
+@deftypefn {Target Hook} bool TARGET_PASS_BY_REFERENCE ( void *@var{cum}, enum machine_mode @var{mode}, const_tree @var{type}, bool @var{named})
 This target hook should return @code{true} if an argument at the
 position indicated by @var{cum} should be passed by reference.  This
 predicate is queried after target independent reasons for being
@@ -4084,7 +4084,7 @@ passed by reference, such as @code{TREE_
 to that type.
 @end deftypefn
 
-@deftypefn {Target Hook} bool TARGET_CALLEE_COPIES (CUMULATIVE_ARGS *@var{cum}, enum machine_mode @var{mode}, const_tree @var{type}, bool @var{named})
+@deftypefn {Target Hook} bool TARGET_CALLEE_COPIES ( void *@var{cum}, enum machine_mode @var{mode}, const_tree @var{type}, bool @var{named})
 The function argument described by the parameters to this hook is
 known to be passed by reference.  The hook should return true if the
 function argument should be copied by the callee instead of copied
@@ -5018,7 +5018,7 @@ @deftypefn {Target Hook} rtx TARGET_EXPA
 to use as the return of @code{__builtin_saveregs}.
 @end deftypefn
 
-@deftypefn {Target Hook} void TARGET_SETUP_INCOMING_VARARGS (CUMULATIVE_ARGS *@var{args_so_far}, enum machine_mode @var{mode}, tree @var{type}, int *@var{pretend_args_size}, int @var{second_time})
+@deftypefn {Target Hook} void TARGET_SETUP_INCOMING_VARARGS ( void *@var{args_so_far}, enum machine_mode @var{mode}, tree @var{type}, int *@var{pretend_args_size}, int @var{second_time})
 This target hook offers an alternative to using
 @code{__builtin_saveregs} and defining the hook
 @code{TARGET_EXPAND_BUILTIN_SAVEREGS}.  Use it to store the anonymous
@@ -5052,7 +5052,7 @@ structure, containing the values that ar
 not generate any instructions in this case.
 @end deftypefn
 
-@deftypefn {Target Hook} bool TARGET_STRICT_ARGUMENT_NAMING (CUMULATIVE_ARGS *@var{ca})
+@deftypefn {Target Hook} bool TARGET_STRICT_ARGUMENT_NAMING ( void *@var{ca})
 Define this hook to return @code{true} if the location where a function
 argument is passed depends on whether or not it is a named argument.
 
@@ -5067,7 +5067,7 @@ @deftypefn {Target Hook} bool TARGET_STR
 You need not define this hook if it always returns @code{false}.
 @end deftypefn
 
-@deftypefn {Target Hook} bool TARGET_PRETEND_OUTGOING_VARARGS_NAMED (CUMULATIVE_ARGS *@var{ca})
+@deftypefn {Target Hook} bool TARGET_PRETEND_OUTGOING_VARARGS_NAMED ( void *@var{ca})
 If you need to conditionally change ABIs so that one works with
 @code{TARGET_SETUP_INCOMING_VARARGS}, but the other works like neither
 @code{TARGET_SETUP_INCOMING_VARARGS} nor @code{TARGET_STRICT_ARGUMENT_NAMING} was
Index: targhooks.c
===================================================================
--- targhooks.c	(revision 166792)
+++ targhooks.c	(working copy)
@@ -167,7 +167,7 @@ default_expand_builtin_saveregs (void)
 }
 
 void
-default_setup_incoming_varargs (CUMULATIVE_ARGS *ca ATTRIBUTE_UNUSED,
+default_setup_incoming_varargs (void *ca ATTRIBUTE_UNUSED,
 				enum machine_mode mode ATTRIBUTE_UNUSED,
 				tree type ATTRIBUTE_UNUSED,
 				int *pretend_arg_size ATTRIBUTE_UNUSED,
@@ -183,16 +183,16 @@ default_builtin_setjmp_frame_value (void
   return virtual_stack_vars_rtx;
 }
 
-/* Generic hook that takes a CUMULATIVE_ARGS pointer and returns false.  */
+/* Generic hook that takes a void pointer and returns false.  */
 
 bool
-hook_bool_CUMULATIVE_ARGS_false (CUMULATIVE_ARGS *ca ATTRIBUTE_UNUSED)
+hook_bool_voidptr_false (void *ca ATTRIBUTE_UNUSED)
 {
   return false;
 }
 
 bool
-default_pretend_outgoing_varargs_named (CUMULATIVE_ARGS *ca ATTRIBUTE_UNUSED)
+default_pretend_outgoing_varargs_named (void *ca ATTRIBUTE_UNUSED)
 {
   return (targetm.calls.setup_incoming_varargs
 	  != default_setup_incoming_varargs);
@@ -247,10 +247,10 @@ default_mode_rep_extended (enum machine_
   return UNKNOWN;
 }
 
-/* Generic hook that takes a CUMULATIVE_ARGS pointer and returns true.  */
+/* Generic hook that takes a void pointer and returns true.  */
 
 bool
-hook_bool_CUMULATIVE_ARGS_true (CUMULATIVE_ARGS * a ATTRIBUTE_UNUSED)
+hook_bool_voidptr_true (void * a ATTRIBUTE_UNUSED)
 {
   return true;
 }
@@ -299,7 +299,7 @@ default_cxx_get_cookie_size (tree type)
    of the TARGET_PASS_BY_REFERENCE hook uses just MUST_PASS_IN_STACK.  */
 
 bool
-hook_pass_by_reference_must_pass_in_stack (CUMULATIVE_ARGS *c ATTRIBUTE_UNUSED,
+hook_pass_by_reference_must_pass_in_stack (void *c ATTRIBUTE_UNUSED,
 	enum machine_mode mode ATTRIBUTE_UNUSED, const_tree type ATTRIBUTE_UNUSED,
 	bool named_arg ATTRIBUTE_UNUSED)
 {
@@ -310,7 +310,7 @@ hook_pass_by_reference_must_pass_in_stac
    version of the hook is true for all named arguments.  */
 
 bool
-hook_callee_copies_named (CUMULATIVE_ARGS *ca ATTRIBUTE_UNUSED,
+hook_callee_copies_named (void *ca ATTRIBUTE_UNUSED,
 			  enum machine_mode mode ATTRIBUTE_UNUSED,
 			  const_tree type ATTRIBUTE_UNUSED, bool named)
 {
@@ -540,8 +540,8 @@ default_builtin_reciprocal (unsigned int
 }
 
 bool
-hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false (
-	CUMULATIVE_ARGS *ca ATTRIBUTE_UNUSED,
+hook_bool_voidptr_mode_tree_bool_false (
+	void *ca ATTRIBUTE_UNUSED,
 	enum machine_mode mode ATTRIBUTE_UNUSED,
 	const_tree type ATTRIBUTE_UNUSED, bool named ATTRIBUTE_UNUSED)
 {
@@ -549,8 +549,8 @@ hook_bool_CUMULATIVE_ARGS_mode_tree_bool
 }
 
 bool
-hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true (
-	CUMULATIVE_ARGS *ca ATTRIBUTE_UNUSED,
+hook_bool_voidptr_mode_tree_bool_true (
+	void *ca ATTRIBUTE_UNUSED,
 	enum machine_mode mode ATTRIBUTE_UNUSED,
 	const_tree type ATTRIBUTE_UNUSED, bool named ATTRIBUTE_UNUSED)
 {
@@ -558,8 +558,8 @@ hook_bool_CUMULATIVE_ARGS_mode_tree_bool
 }
 
 int
-hook_int_CUMULATIVE_ARGS_mode_tree_bool_0 (
-	CUMULATIVE_ARGS *ca ATTRIBUTE_UNUSED,
+hook_int_voidptr_mode_tree_bool_0 (
+	void *ca ATTRIBUTE_UNUSED,
 	enum machine_mode mode ATTRIBUTE_UNUSED,
 	tree type ATTRIBUTE_UNUSED, bool named ATTRIBUTE_UNUSED)
 {
@@ -567,13 +567,13 @@ hook_int_CUMULATIVE_ARGS_mode_tree_bool_
 }
 
 void
-default_function_arg_advance (CUMULATIVE_ARGS *ca ATTRIBUTE_UNUSED,
+default_function_arg_advance (void *ca ATTRIBUTE_UNUSED,
 			      enum machine_mode mode ATTRIBUTE_UNUSED,
 			      const_tree type ATTRIBUTE_UNUSED,
 			      bool named ATTRIBUTE_UNUSED)
 {
 #ifdef FUNCTION_ARG_ADVANCE
-  CUMULATIVE_ARGS args = *ca;
+  CUMULATIVE_ARGS args = *(CUMULATIVE_ARGS *) ca;
   FUNCTION_ARG_ADVANCE (args, mode, CONST_CAST_TREE (type), named);
   *ca = args;
 #else
@@ -582,7 +582,7 @@ default_function_arg_advance (CUMULATIVE
 }
 
 rtx
-default_function_arg (CUMULATIVE_ARGS *ca ATTRIBUTE_UNUSED,
+default_function_arg (void *ca ATTRIBUTE_UNUSED,
 		      enum machine_mode mode ATTRIBUTE_UNUSED,
 		      const_tree type ATTRIBUTE_UNUSED,
 		      bool named ATTRIBUTE_UNUSED)
@@ -595,7 +595,7 @@ default_function_arg (CUMULATIVE_ARGS *c
 }
 
 rtx
-default_function_incoming_arg (CUMULATIVE_ARGS *ca ATTRIBUTE_UNUSED,
+default_function_incoming_arg (void *ca ATTRIBUTE_UNUSED,
 			       enum machine_mode mode ATTRIBUTE_UNUSED,
 			       const_tree type ATTRIBUTE_UNUSED,
 			       bool named ATTRIBUTE_UNUSED)
Index: targhooks.h
===================================================================
--- targhooks.h	(revision 166792)
+++ targhooks.h	(working copy)
@@ -35,9 +35,9 @@ extern enum machine_mode default_cc_mode
 extern bool default_return_in_memory (const_tree, const_tree);
 
 extern rtx default_expand_builtin_saveregs (void);
-extern void default_setup_incoming_varargs (CUMULATIVE_ARGS *, enum machine_mode, tree, int *, int);
+extern void default_setup_incoming_varargs (void *, enum machine_mode, tree, int *, int);
 extern rtx default_builtin_setjmp_frame_value (void);
-extern bool default_pretend_outgoing_varargs_named (CUMULATIVE_ARGS *);
+extern bool default_pretend_outgoing_varargs_named (void *);
 
 extern enum machine_mode default_eh_return_filter_mode (void);
 extern enum machine_mode default_libgcc_cmp_return_mode (void);
@@ -58,9 +58,9 @@ extern tree default_cxx_guard_type (void
 extern tree default_cxx_get_cookie_size (tree);
 
 extern bool hook_pass_by_reference_must_pass_in_stack
-  (CUMULATIVE_ARGS *, enum machine_mode mode, const_tree, bool);
+  (void *, enum machine_mode mode, const_tree, bool);
 extern bool hook_callee_copies_named
-  (CUMULATIVE_ARGS *ca, enum machine_mode, const_tree, bool);
+  (void *ca, enum machine_mode, const_tree, bool);
 
 extern void default_print_operand (FILE *, rtx, int);
 extern void default_print_operand_address (FILE *, rtx);
@@ -91,26 +91,27 @@ default_builtin_support_vector_misalignm
 extern enum machine_mode default_preferred_simd_mode (enum machine_mode mode);
 extern unsigned int default_autovectorize_vector_sizes (void);
 
-/* These are here, and not in hooks.[ch], because not all users of
-   hooks.h include tm.h, and thus we don't have CUMULATIVE_ARGS.  */
-
-extern bool hook_bool_CUMULATIVE_ARGS_false (CUMULATIVE_ARGS *);
-extern bool hook_bool_CUMULATIVE_ARGS_true (CUMULATIVE_ARGS *);
-
-extern bool hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false
-  (CUMULATIVE_ARGS *, enum machine_mode, const_tree, bool);
-extern bool hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true
-  (CUMULATIVE_ARGS *, enum machine_mode, const_tree, bool);
-extern int hook_int_CUMULATIVE_ARGS_mode_tree_bool_0
-  (CUMULATIVE_ARGS *, enum machine_mode, tree, bool);
+/* These came here, and not into hooks.[ch], because not all users of
+   hooks.h included tm.h, and thus we didn't have CUMULATIVE_ARGS.
+   Well, no we don't have it either way.  */
+
+extern bool hook_bool_voidptr_false (void *);
+extern bool hook_bool_voidptr_true (void *);
+
+extern bool hook_bool_voidptr_mode_tree_bool_false
+  (void *, enum machine_mode, const_tree, bool);
+extern bool hook_bool_voidptr_mode_tree_bool_true
+  (void *, enum machine_mode, const_tree, bool);
+extern int hook_int_voidptr_mode_tree_bool_0
+  (void *, enum machine_mode, tree, bool);
 extern const char *hook_invalid_arg_for_unprototyped_fn
   (const_tree, const_tree, const_tree);
 extern void default_function_arg_advance
-  (CUMULATIVE_ARGS *, enum machine_mode, const_tree, bool);
+  (void *, enum machine_mode, const_tree, bool);
 extern rtx default_function_arg
-  (CUMULATIVE_ARGS *, enum machine_mode, const_tree, bool);
+  (void *, enum machine_mode, const_tree, bool);
 extern rtx default_function_incoming_arg
-  (CUMULATIVE_ARGS *, enum machine_mode, const_tree, bool);
+  (void *, enum machine_mode, const_tree, bool);
 extern bool hook_bool_const_rtx_commutative_p (const_rtx, int);
 extern rtx default_function_value (const_tree, const_tree, bool);
 extern rtx default_libcall_value (enum machine_mode, const_rtx);
Index: c-family/c-opts.c
===================================================================
--- c-family/c-opts.c	(revision 166792)
+++ c-family/c-opts.c	(working copy)
@@ -22,6 +22,7 @@ Software Foundation; either version 3, o
 #include "config.h"
 #include "system.h"
 #include "coretypes.h"
+#include "tm.h"
 #include "tree.h"
 #include "c-common.h"
 #include "c-pragma.h"
Index: java/decl.c
===================================================================
--- java/decl.c	(revision 166792)
+++ java/decl.c	(working copy)
@@ -28,6 +28,7 @@ the Free Software Foundation; either ver
 #include "config.h"
 #include "system.h"
 #include "coretypes.h"
+#include "tm.h"
 #include "tree.h"
 #include "diagnostic-core.h"
 #include "toplev.h"
Index: java/jcf-parse.c
===================================================================
--- java/jcf-parse.c	(revision 166792)
+++ java/jcf-parse.c	(working copy)
@@ -27,6 +27,7 @@ the Free Software Foundation; either ver
 #include "config.h"
 #include "system.h"
 #include "coretypes.h"
+#include "tm.h"
 #include "tree.h"
 #include "obstack.h"
 #include "flags.h"
Index: java/expr.c
===================================================================
--- java/expr.c	(revision 166792)
+++ java/expr.c	(working copy)
@@ -27,6 +27,7 @@ the Free Software Foundation; either ver
 #include "config.h"
 #include "system.h"
 #include "coretypes.h"
+#include "tm.h"
 #include "tree.h"
 #include "flags.h"
 #include "java-tree.h"
Index: target.def
===================================================================
--- target.def	(revision 166792)
+++ target.def	(working copy)
@@ -1890,8 +1890,9 @@ HOOK_VECTOR (TARGET_CALLS, calls)
 (pass_by_reference,
  "",
  bool,
- (CUMULATIVE_ARGS *cum, enum machine_mode mode, const_tree type, bool named),
- hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false)
+ (/* CUMULATIVE_ARGS* */ void *cum, enum machine_mode mode,
+  const_tree type, bool named),
+ hook_bool_voidptr_mode_tree_bool_false)
 
 DEFHOOK
 (expand_builtin_saveregs,
@@ -1903,15 +1904,15 @@ HOOK_VECTOR (TARGET_CALLS, calls)
 DEFHOOK
 (setup_incoming_varargs,
  "",
- void, (CUMULATIVE_ARGS *args_so_far, enum machine_mode mode, tree type,
-	int *pretend_args_size, int second_time),
+ void, (/* CUMULATIVE_ARGS* */ void *args_so_far, enum machine_mode mode,
+	tree type, int *pretend_args_size, int second_time),
  default_setup_incoming_varargs)
 
 DEFHOOK
 (strict_argument_naming,
  "",
- bool, (CUMULATIVE_ARGS *ca),
- hook_bool_CUMULATIVE_ARGS_false)
+ bool, (/* CUMULATIVE_ARGS* */ void *ca),
+ hook_bool_voidptr_false)
 
 /* Returns true if we should use
    targetm.calls.setup_incoming_varargs() and/or
@@ -1919,7 +1920,7 @@ HOOK_VECTOR (TARGET_CALLS, calls)
 DEFHOOK
 (pretend_outgoing_varargs_named,
  "",
- bool, (CUMULATIVE_ARGS *ca),
+ bool, (/* CUMULATIVE_ARGS* */ void *ca),
  default_pretend_outgoing_varargs_named)
 
 /* Given a complex type T, return true if a parameter of type T
@@ -1946,8 +1947,9 @@ HOOK_VECTOR (TARGET_CALLS, calls)
 (callee_copies,
  "",
  bool,
- (CUMULATIVE_ARGS *cum, enum machine_mode mode, const_tree type, bool named),
- hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false)
+ (/* CUMULATIVE_ARGS* */ void *cum, enum machine_mode mode, const_tree type,
+  bool named),
+ hook_bool_voidptr_mode_tree_bool_false)
 
 /* Return zero for arguments passed entirely on the stack or entirely
    in registers.  If passed in both, return the number of bytes passed
@@ -1955,8 +1957,9 @@ HOOK_VECTOR (TARGET_CALLS, calls)
 DEFHOOK
 (arg_partial_bytes,
  "",
- int, (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type, bool named),
- hook_int_CUMULATIVE_ARGS_mode_tree_bool_0)
+ int, (/* CUMULATIVE_ARGS* */ void *cum, enum machine_mode mode, tree type,
+       bool named),
+ hook_int_voidptr_mode_tree_bool_0)
 
 /* Update the state in CA to advance past an argument in the
    argument list.  The values MODE, TYPE, and NAMED describe that
@@ -1966,7 +1969,8 @@ HOOK_VECTOR (TARGET_CALLS, calls)
 (function_arg_advance,
  "",
  void,
- (CUMULATIVE_ARGS *ca, enum machine_mode mode, const_tree type, bool named),
+ (/* CUMULATIVE_ARGS* */ void *ca, enum machine_mode mode, const_tree type,
+  bool named),
  default_function_arg_advance)
 
 /* Return zero if the argument described by the state of CA should
@@ -1977,7 +1981,7 @@ HOOK_VECTOR (TARGET_CALLS, calls)
 DEFHOOK_UNDOC
 (function_arg,
  "",
- rtx, (CUMULATIVE_ARGS *ca, enum machine_mode mode, const_tree type,
+ rtx, (/* CUMULATIVE_ARGS* */ void *ca, enum machine_mode mode, const_tree type,
        bool named),
  default_function_arg)
 
@@ -1987,8 +1991,8 @@ HOOK_VECTOR (TARGET_CALLS, calls)
 DEFHOOK_UNDOC
 (function_incoming_arg,
  "",
- rtx, (CUMULATIVE_ARGS *ca, enum machine_mode mode, const_tree type,
-       bool named),
+ rtx, (/* CUMULATIVE_ARGS* */ void *ca, enum machine_mode mode,
+       const_tree type, bool named),
  default_function_incoming_arg)
 
 /* Return the diagnostic message string if function without a prototype
Index: target.h
===================================================================
--- target.h	(revision 166792)
+++ target.h	(working copy)
@@ -49,7 +49,6 @@
 #ifndef GCC_TARGET_H
 #define GCC_TARGET_H
 
-#include "tm.h"
 #include "insn-modes.h"
 
 /* Types used by the record_gcc_switches() target function.  */
Index: expr.c
===================================================================
--- expr.c	(revision 166792)
+++ expr.c	(working copy)
@@ -8437,7 +8437,7 @@ expand_expr_real_1 (tree exp, rtx target
 	    int nregs = hard_regno_nregs[i][GET_MODE (decl_rtl)];
 	    while (nregs)
 	      {
-		SET_HARD_REG_BIT (crtl->asm_clobbers, i);
+		SET_HARD_REG_BIT (ctmrtl->asm_clobbers, i);
 		i++;
 		nregs--;
 	      }
Index: fortran/trans-types.c
===================================================================
--- fortran/trans-types.c	(revision 166792)
+++ fortran/trans-types.c	(working copy)
@@ -26,6 +26,7 @@ Software Foundation; either version 3, o
 #include "config.h"
 #include "system.h"
 #include "coretypes.h"
+#include "tm.h"
 #include "tree.h"
 #include "langhooks.h"	/* For iso-c-bindings.def.  */
 #include "target.h"
Index: function.c
===================================================================
--- function.c	(revision 166792)
+++ function.c	(working copy)
@@ -215,6 +215,7 @@ free_after_compilation (struct function 
     free (crtl->emit.regno_pointer_align);
 
   memset (crtl, 0, sizeof (struct rtl_data));
+  memset (ctmrtl, 0, sizeof (struct rtl_tm_data));
   f->eh = NULL;
   f->machine = NULL;
   f->cfg = NULL;
@@ -3463,7 +3464,7 @@ assign_parms (tree fndecl)
   /* For stdarg.h function, save info about
      regs and stack space used by the named args.  */
 
-  crtl->args.info = all.args_so_far;
+  ctmrtl->args_info = all.args_so_far;
 
   /* Set the rtx used for the function return value.  Put this in its
      own variable so any optimizers that need this information don't have
Index: function.h
===================================================================
--- function.h	(revision 166792)
+++ function.h	(working copy)
@@ -25,8 +25,9 @@ Software Foundation; either version 3, o
 #include "tree.h"
 #include "hashtab.h"
 #include "vecprim.h"
-#include "tm.h"		/* For CUMULATIVE_ARGS.  */
+#ifdef GCC_TM_H
 #include "hard-reg-set.h"
+#endif /* GCC_TM_H */
 
 /* Stack of pending (incomplete) sequences saved by `start_sequence'.
    Each element describes one pending sequence.
@@ -208,10 +209,6 @@ struct GTY(()) incoming_args {
      anonymous arg can be found, if there is one.  */
   rtx arg_offset_rtx;
 
-  /* Quantities of various kinds of registers
-     used for the current function's args.  */
-  CUMULATIVE_ARGS info;
-
   /* The arg pointer hard register, or the pseudo into which it was copied.  */
   rtx internal_arg_pointer;
 };
@@ -438,6 +435,15 @@ struct GTY(()) rtl_data {
      TREE_NOTHROW (current_function_decl) it is set even for overwritable
      function where currently compiled version of it is nothrow.  */
   bool nothrow;
+};
+
+#ifdef GCC_TM_H
+/* Datastructures maintained for currently processed function in RTL form,
+   which require inclusion of tm.h .  */
+struct GTY(()) rtl_tm_data {
+  /* Quantities of various kinds of registers
+     used for the current function's args.  */
+  CUMULATIVE_ARGS args_info;
 
   /* Like regs_ever_live, but 1 if a reg is set or clobbered from an
      asm.  Unlike regs_ever_live, elements of this array corresponding
@@ -445,6 +451,7 @@ struct GTY(()) rtl_data {
      sets them.  */
   HARD_REG_SET asm_clobbers;
 };
+#endif /* GCC_TM_H */
 
 #define return_label (crtl->x_return_label)
 #define naked_return_label (crtl->x_naked_return_label)
@@ -462,11 +469,13 @@ struct GTY(()) rtl_data {
 #define stack_realign_drap (crtl->stack_realign_needed && crtl->need_drap)
 
 extern GTY(()) struct rtl_data x_rtl;
+extern GTY(()) struct rtl_tm_data x_tm_rtl;
 
 /* Accessor to RTL datastructures.  We keep them statically allocated now since
    we never keep multiple functions.  For threaded compiler we might however
    want to do differently.  */
 #define crtl (&x_rtl)
+#define ctmrtl (&x_tm_rtl)
 
 struct GTY(()) stack_usage
 {
@@ -751,10 +760,12 @@ extern const char *current_function_name
 
 extern void do_warn_unused_parameter (tree);
 
+#ifdef GCC_TM_H
 extern bool pass_by_reference (CUMULATIVE_ARGS *, enum machine_mode,
 			       tree, bool);
 extern bool reference_callee_copied (CUMULATIVE_ARGS *, enum machine_mode,
 				     tree, bool);
+#endif /* GCC_TM_H */
 
 extern void used_types_insert (tree);
 
Index: emit-rtl.c
===================================================================
--- emit-rtl.c	(revision 166792)
+++ emit-rtl.c	(working copy)
@@ -78,6 +78,7 @@ enum machine_mode ptr_mode;	/* Mode whos
 /* Datastructures maintained for currently processed function in RTL form.  */
 
 struct rtl_data x_rtl;
+struct rtl_tm_data x_tm_rtl;
 
 /* Indexed by pseudo register number, gives the rtx for that pseudo.
    Allocated in parallel with regno_pointer_align.
Index: ira.c
===================================================================
--- ira.c	(revision 166792)
+++ ira.c	(working copy)
@@ -1328,7 +1328,7 @@ compute_regs_asm_clobbered (void)
 		      + hard_regno_nregs[dregno][mode] - 1;
 
 		    for (i = dregno; i <= end; ++i)
-		      SET_HARD_REG_BIT(crtl->asm_clobbers, i);
+		      SET_HARD_REG_BIT(ctmrtl->asm_clobbers, i);
 		  }
 	      }
 	}
@@ -1374,7 +1374,7 @@ ira_setup_eliminable_regset (void)
 	= (! targetm.can_eliminate (eliminables[i].from, eliminables[i].to)
 	   || (eliminables[i].to == STACK_POINTER_REGNUM && need_fp));
 
-      if (!TEST_HARD_REG_BIT (crtl->asm_clobbers, eliminables[i].from))
+      if (!TEST_HARD_REG_BIT (ctmrtl->asm_clobbers, eliminables[i].from))
 	{
 	    SET_HARD_REG_BIT (eliminable_regset, eliminables[i].from);
 
@@ -1388,7 +1388,7 @@ ira_setup_eliminable_regset (void)
 	df_set_regs_ever_live (eliminables[i].from, true);
     }
 #if !HARD_FRAME_POINTER_IS_FRAME_POINTER
-  if (!TEST_HARD_REG_BIT (crtl->asm_clobbers, HARD_FRAME_POINTER_REGNUM))
+  if (!TEST_HARD_REG_BIT (ctmrtl->asm_clobbers, HARD_FRAME_POINTER_REGNUM))
     {
       SET_HARD_REG_BIT (eliminable_regset, HARD_FRAME_POINTER_REGNUM);
       if (need_fp)
Index: config/arm/arm.c
===================================================================
--- config/arm/arm.c	(revision 166792)
+++ config/arm/arm.c	(working copy)
@@ -162,11 +162,9 @@ static rtx arm_expand_unop_builtin (enum
 static rtx arm_expand_builtin (tree, rtx, rtx, enum machine_mode, int);
 static void emit_constant_insn (rtx cond, rtx pattern);
 static rtx emit_set_insn (rtx, rtx);
-static int arm_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode,
-				  tree, bool);
-static rtx arm_function_arg (CUMULATIVE_ARGS *, enum machine_mode,
-			     const_tree, bool);
-static void arm_function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode,
+static int arm_arg_partial_bytes (void *, enum machine_mode, tree, bool);
+static rtx arm_function_arg (void *, enum machine_mode, const_tree, bool);
+static void arm_function_arg_advance (void *, enum machine_mode,
 				      const_tree, bool);
 static rtx aapcs_allocate_return_reg (enum machine_mode, const_tree,
 				      const_tree);
@@ -183,9 +181,9 @@ static void arm_encode_section_info (tre
 static void arm_file_end (void);
 static void arm_file_start (void);
 
-static void arm_setup_incoming_varargs (CUMULATIVE_ARGS *, enum machine_mode,
+static void arm_setup_incoming_varargs (void *, enum machine_mode,
 					tree, int *, int);
-static bool arm_pass_by_reference (CUMULATIVE_ARGS *,
+static bool arm_pass_by_reference (void *,
 				   enum machine_mode, const_tree, bool);
 static bool arm_promote_prototypes (const_tree);
 static bool arm_default_short_enums (void);
@@ -4555,9 +4553,10 @@ arm_needs_doubleword_align (enum machine
    indeed make it pass in the stack if necessary).  */
 
 static rtx
-arm_function_arg (CUMULATIVE_ARGS *pcum, enum machine_mode mode,
+arm_function_arg (void *pcum_v, enum machine_mode mode,
 		  const_tree type, bool named)
 {
+  CUMULATIVE_ARGS *pcum = (CUMULATIVE_ARGS *) pcum_v;
   int nregs;
 
   /* Handle the special case quickly.  Pick an arbitrary value for op2 of
@@ -4607,9 +4606,11 @@ arm_function_arg (CUMULATIVE_ARGS *pcum,
 }
 
 static int
-arm_arg_partial_bytes (CUMULATIVE_ARGS *pcum, enum machine_mode mode,
+arm_arg_partial_bytes (void *pcum_v, enum machine_mode mode,
 		       tree type, bool named)
 {
+  CUMULATIVE_ARGS *pcum = (CUMULATIVE_ARGS *) pcum_v;
+
   int nregs = pcum->nregs;
 
   if (pcum->pcs_variant <= ARM_PCS_AAPCS_LOCAL)
@@ -4634,9 +4635,11 @@ arm_arg_partial_bytes (CUMULATIVE_ARGS *
    (TYPE is null for libcalls where that information may not be available.)  */
 
 static void
-arm_function_arg_advance (CUMULATIVE_ARGS *pcum, enum machine_mode mode,
+arm_function_arg_advance (void *pcum_v, enum machine_mode mode,
 			  const_tree type, bool named)
 {
+  CUMULATIVE_ARGS *pcum = (CUMULATIVE_ARGS *) pcum_v;
+
   if (pcum->pcs_variant <= ARM_PCS_AAPCS_LOCAL)
     {
       aapcs_layout_arg (pcum, mode, type, named);
@@ -4670,7 +4673,7 @@ arm_function_arg_advance (CUMULATIVE_ARG
    extension to the ARM ABI.  */
 
 static bool
-arm_pass_by_reference (CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED,
+arm_pass_by_reference (void *cum ATTRIBUTE_UNUSED,
 		       enum machine_mode mode ATTRIBUTE_UNUSED,
 		       const_tree type, bool named ATTRIBUTE_UNUSED)
 {
@@ -5241,7 +5244,7 @@ thumb_find_work_register (unsigned long 
   if (! cfun->machine->uses_anonymous_args
       && crtl->args.size >= 0
       && crtl->args.size <= (LAST_ARG_REGNUM * UNITS_PER_WORD)
-      && crtl->args.info.nregs < 4)
+      && ctmrtl->args_info.nregs < 4)
     return LAST_ARG_REGNUM;
 
   /* Otherwise look for a call-saved register that is going to be pushed.  */
@@ -21561,12 +21564,13 @@ arm_output_load_gr (rtx *operands)
    that way.  */
 
 static void
-arm_setup_incoming_varargs (CUMULATIVE_ARGS *pcum,
+arm_setup_incoming_varargs (void *pcum_v,
 			    enum machine_mode mode,
 			    tree type,
 			    int *pretend_size,
 			    int second_time ATTRIBUTE_UNUSED)
 {
+  CUMULATIVE_ARGS *pcum = (CUMULATIVE_ARGS *) pcum_v;
   int nregs;
   
   cfun->machine->uses_anonymous_args = 1;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]