OSDN Git Service

(struct function): Make frame_offset be HOST_WIDE_INT.
[pf3gnuchains/gcc-fork.git] / gcc / rtl.h
index 945fbc8..733f881 100644 (file)
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -1,5 +1,5 @@
 /* Register Transfer Language (RTL) definitions for GNU C-Compiler
-   Copyright (C) 1987, 1991, 1992 Free Software Foundation, Inc.
+   Copyright (C) 1987, 91-95, 1996 Free Software Foundation, Inc.
 
 This file is part of GNU CC.
 
@@ -15,7 +15,8 @@ GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with GNU CC; see the file COPYING.  If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
 
 
 #include "machmode.h"
@@ -25,6 +26,10 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #undef ABS /* Likewise.  */
 #undef PC /* Likewise.  */
 
+#ifndef TREE_CODE
+union tree_node;
+#endif
+
 /* Register Transfer Language EXPRESSIONS CODES */
 
 #define RTX_CODE       enum rtx_code
@@ -42,16 +47,16 @@ enum rtx_code  {
                                /* The cast here, saves many elsewhere.  */
 
 extern int rtx_length[];
-#define GET_RTX_LENGTH(CODE)           (rtx_length[(int)(CODE)])
+#define GET_RTX_LENGTH(CODE)           (rtx_length[(int) (CODE)])
 
 extern char *rtx_name[];
-#define GET_RTX_NAME(CODE)             (rtx_name[(int)(CODE)])
+#define GET_RTX_NAME(CODE)             (rtx_name[(int) (CODE)])
 
 extern char *rtx_format[];
-#define GET_RTX_FORMAT(CODE)           (rtx_format[(int)(CODE)])
+#define GET_RTX_FORMAT(CODE)           (rtx_format[(int) (CODE)])
 
 extern char rtx_class[];
-#define GET_RTX_CLASS(CODE)            (rtx_class[(int)(CODE)])
+#define GET_RTX_CLASS(CODE)            (rtx_class[(int) (CODE)])
 \f
 /* Common union for an element of an rtx.  */
 
@@ -139,53 +144,12 @@ typedef struct rtx_def
      The number of operands and their types are controlled
      by the `code' field, according to rtl.def.  */
   rtunion fld[1];
-
-  /* The rest is used instead of the above if bytecode is being output */
-
-  /* For static or external objects.  */
-  char *label;
-
-  /* From the named label, or the local variable pointer or the
-     argument pointer, depending on context.  */
-
-  int offset;
-
-  /* For goto labels inside bytecode functions.  */
-  struct bc_label *bc_label;
-
-  /* A unique identifier */
-  int uid;
 } *rtx;
 
-/* Add prototype support.  */
-#ifndef PROTO
-#if defined (USE_PROTOTYPES) ? USE_PROTOTYPES : defined (__STDC__)
-#define PROTO(ARGS) ARGS
-#else
-#define PROTO(ARGS) ()
-#endif
-#endif
+#include "gansidecl.h"
 
 #define NULL_RTX (rtx) 0
 
-/* Define a generic NULL if one hasn't already been defined.  */
-
-#ifndef NULL
-#define NULL 0
-#endif
-
-#ifndef GENERIC_PTR
-#if defined (USE_PROTOTYPES) ? USE_PROTOTYPES : defined (__STDC__)
-#define GENERIC_PTR void *
-#else
-#define GENERIC_PTR char *
-#endif
-#endif
-
-#ifndef NULL_PTR
-#define NULL_PTR ((GENERIC_PTR)0)
-#endif
-
 /* Define macros to access the `code' field of the rtx.  */
 
 #ifdef SHORT_ENUM_BUG
@@ -347,7 +311,16 @@ enum reg_note { REG_DEAD = 1, REG_INC = 2, REG_EQUIV = 3, REG_WAS_0 = 4,
 /* Names for REG_NOTE's in EXPR_LIST insn's.  */
 
 extern char *reg_note_name[];
-#define GET_REG_NOTE_NAME(MODE) (reg_note_name[(int)(MODE)])
+#define GET_REG_NOTE_NAME(MODE) (reg_note_name[(int) (MODE)])
+
+/* This field is only present on CALL_INSNs.  It holds a chain of EXPR_LIST of
+   USE and CLOBBER expressions.
+     USE expressions list the registers filled with arguments that
+   are passed to the function.
+     CLOBBER expressions document the registers explicitly clobbered
+   by this CALL_INSN.
+     Pseudo registers can not be mentioned in this list.  */
+#define CALL_INSN_FUNCTION_USAGE(INSN) ((INSN)->fld[7].rtx)
 
 /* The label-number of a code-label.  The assembler label
    is made from `L' and the label-number printed in decimal.
@@ -411,6 +384,9 @@ extern char *reg_note_name[];
    i.e. the point just after all of the parms have been moved into
    their homes, etc.  */
 #define NOTE_INSN_FUNCTION_BEG -13
+/* These note where exception handling regions begin and end.  */
+#define NOTE_INSN_EH_REGION_BEG -14
+#define NOTE_INSN_EH_REGION_END -15
 
 
 #if 0 /* These are not used, and I don't know what they were for. --rms.  */
@@ -434,6 +410,17 @@ extern char *note_insn_name[];
    of LABEL_REFs that point at it, so unused labels can be deleted.  */
 #define LABEL_NUSES(LABEL) ((LABEL)->fld[5].rtint)
 
+/* The rest is used instead of the above, in a CODE_LABEL,
+   if bytecode is being output.
+   We make the slightly kludgy assumption that a LABEL has enough slots
+   to hold these things.  That happens to be true.  */
+
+/* For static or external objects.  */
+#define BYTECODE_LABEL(X) (XEXP ((X), 0))
+
+/* For goto labels inside bytecode functions.  */
+#define BYTECODE_BC_LABEL(X) (*(struct bc_label **) &XEXP ((X), 1))
+
 /* In jump.c, each JUMP_INSN can point to a label that it can jump to,
    so that if the JUMP_INSN is deleted, the label's LABEL_NUSES can
    be decremented and possibly the label can be deleted.  */
@@ -567,12 +554,15 @@ extern char *note_insn_name[];
    FUNCTION_ARGS_SIZE is the size of the argument block in the stack.
    POPS_ARGS is the number of bytes of input arguments popped by the function
    STACK_SLOT_LIST is the list of stack slots.
+   FORCED_LABELS is the list of labels whose address was taken.
    FUNCTION_FLAGS are where single-bit flags are saved.
    OUTGOING_ARGS_SIZE is the size of the largest outgoing stack parameter list.
    ORIGINAL_ARG_VECTOR is a vector of the original DECL_RTX values
     for the function arguments.
    ORIGINAL_DECL_INITIAL is a pointer to the original DECL_INITIAL for the
     function.
+   INLINE_REGNO_REG_RTX, INLINE_REGNO_POINTER_FLAG, and
+    INLINE_REGNO_POINTER_ALIGN are pointers to the corresponding arrays.
 
    We want this to lay down like an INSN.  The PREV_INSN field
    is always NULL.  The NEXT_INSN field always points to the
@@ -587,10 +577,14 @@ extern char *note_insn_name[];
 #define FUNCTION_ARGS_SIZE(RTX) ((RTX)->fld[8].rtint)
 #define POPS_ARGS(RTX) ((RTX)->fld[9].rtint)
 #define STACK_SLOT_LIST(RTX) ((RTX)->fld[10].rtx)
-#define FUNCTION_FLAGS(RTX) ((RTX)->fld[11].rtint)
-#define OUTGOING_ARGS_SIZE(RTX) ((RTX)->fld[12].rtint)
-#define ORIGINAL_ARG_VECTOR(RTX) ((RTX)->fld[13].rtvec)
-#define ORIGINAL_DECL_INITIAL(RTX) ((RTX)->fld[14].rtx)
+#define FORCED_LABELS(RTX) ((RTX)->fld[11].rtx)
+#define FUNCTION_FLAGS(RTX) ((RTX)->fld[12].rtint)
+#define OUTGOING_ARGS_SIZE(RTX) ((RTX)->fld[13].rtint)
+#define ORIGINAL_ARG_VECTOR(RTX) ((RTX)->fld[14].rtvec)
+#define ORIGINAL_DECL_INITIAL(RTX) ((RTX)->fld[15].rtx)
+#define INLINE_REGNO_REG_RTX(RTX) ((RTX)->fld[16].rtvec)
+#define INLINE_REGNO_POINTER_FLAG(RTX) ((RTX)->fld[17].rtstr)
+#define INLINE_REGNO_POINTER_ALIGN(RTX) ((RTX)->fld[18].rtstr)
 
 /* In FUNCTION_FLAGS we save some variables computed when emitting the code
    for the function and which must be `or'ed into the current flag values when
@@ -645,27 +639,15 @@ extern char *note_insn_name[];
 extern rtx plus_constant_wide           PROTO((rtx, HOST_WIDE_INT));
 extern rtx plus_constant_for_output_wide PROTO((rtx, HOST_WIDE_INT));
 
-#define GEN_INT(N) gen_rtx (CONST_INT, VOIDmode, (N))
+#define GEN_INT(N) gen_rtx (CONST_INT, VOIDmode, (HOST_WIDE_INT) (N))
 
-#if 0
-/* We cannot define prototypes for the variable argument functions,
-   since they have not been ANSI-fied, and an ANSI compiler would
-   complain when compiling the definition of these functions.  */
-
-extern rtx gen_rtx                     PROTO((enum rtx_code, enum machine_mode, ...));
-extern rtvec gen_rtvec                 PROTO((int, ...));
-
-#else
 extern rtx bc_gen_rtx ();
-extern rtx gen_rtx ();
-extern rtvec gen_rtvec ();
-#endif
 
-#ifdef BUFSIZ                  /* stdio.h has been included */
-extern rtx read_rtx                    PROTO((FILE *));
-#else
-extern rtx read_rtx ();
-#endif
+extern rtx gen_rtx                     PVPROTO((enum rtx_code,
+                                                enum machine_mode, ...));
+extern rtvec gen_rtvec                 PVPROTO((int, ...));
+
+extern rtx read_rtx                    STDIO_PROTO((FILE *));
 
 #if 0
 /* At present, don't prototype xrealloc, since all of the callers don't
@@ -685,6 +667,8 @@ extern rtx rtx_alloc                        PROTO((RTX_CODE));
 extern rtvec rtvec_alloc               PROTO((int));
 extern rtx find_reg_note               PROTO((rtx, enum reg_note, rtx));
 extern rtx find_regno_note             PROTO((rtx, enum reg_note, int));
+extern int find_reg_fusage             PROTO((rtx, enum rtx_code, rtx));
+extern int find_regno_fusage           PROTO((rtx, enum rtx_code, int));
 extern HOST_WIDE_INT get_integer_term  PROTO((rtx));
 extern rtx get_related_value           PROTO((rtx));
 extern rtx single_set                  PROTO((rtx));
@@ -694,9 +678,13 @@ extern rtx copy_rtx_if_shared              PROTO((rtx));
 extern rtx copy_most_rtx               PROTO((rtx, rtx));
 extern rtx replace_rtx                 PROTO((rtx, rtx, rtx));
 extern rtvec gen_rtvec_v               PROTO((int, rtx *));
+extern rtvec gen_rtvec_vv              PROTO((int, rtunion *));
 extern rtx gen_reg_rtx                 PROTO((enum machine_mode));
 extern rtx gen_label_rtx               PROTO((void));
-extern rtx gen_inline_header_rtx       PROTO((rtx, rtx, int, int, int, int, int, int, rtx, int, int, rtvec, rtx));
+extern rtx gen_inline_header_rtx       PROTO((rtx, rtx, int, int, int, int,
+                                              int, int, rtx, rtx, int, int,
+                                              rtvec, rtx,
+                                              rtvec, char *, char *));
 extern rtx gen_lowpart_common          PROTO((enum machine_mode, rtx));
 extern rtx gen_lowpart                 PROTO((enum machine_mode, rtx));
 extern rtx gen_lowpart_if_possible     PROTO((enum machine_mode, rtx));
@@ -707,6 +695,7 @@ extern rtx operand_subword          PROTO((rtx, int, int, enum machine_mode));
 extern rtx operand_subword_force       PROTO((rtx, int, enum machine_mode));
 extern int subreg_lowpart_p            PROTO((rtx));
 extern rtx make_safe_from              PROTO((rtx, rtx));
+extern rtx convert_memory_address      PROTO((enum machine_mode, rtx));
 extern rtx memory_address              PROTO((enum machine_mode, rtx));
 extern rtx get_insns                   PROTO((void));
 extern rtx get_last_insn               PROTO((void));
@@ -724,6 +713,8 @@ extern int get_pool_offset          PROTO((rtx));
 extern rtx simplify_subtraction                PROTO((rtx));
 extern rtx assign_stack_local          PROTO((enum machine_mode, int, int));
 extern rtx assign_stack_temp           PROTO((enum machine_mode, int, int));
+extern rtx assign_temp                 PROTO((union tree_node *, int,
+                                              int, int));
 extern rtx protect_from_queue          PROTO((rtx, int));
 extern void emit_queue                 PROTO((void));
 extern rtx emit_move_insn              PROTO((rtx, rtx));
@@ -741,6 +732,7 @@ extern rtx emit_line_note_after             PROTO((char *, int, rtx));
 extern rtx emit_insn                   PROTO((rtx));
 extern rtx emit_insns                  PROTO((rtx));
 extern rtx emit_insns_before           PROTO((rtx, rtx));
+extern rtx emit_insns_after            PROTO((rtx, rtx));
 extern rtx emit_jump_insn              PROTO((rtx));
 extern rtx emit_call_insn              PROTO((rtx));
 extern rtx emit_label                  PROTO((rtx));
@@ -789,6 +781,7 @@ extern rtx gen_bge                  PROTO((rtx));
 extern rtx gen_ble                     PROTO((rtx));
 extern rtx eliminate_constant_term     PROTO((rtx, rtx *));
 extern rtx expand_complex_abs          PROTO((enum machine_mode, rtx, rtx, int));
+extern enum machine_mode choose_hard_reg_mode PROTO((int, int));
 
 /* Maximum number of parallel sets and clobbers in any insn in this fn.
    Always at least 3, since the combiner could put that many togetherm
@@ -830,6 +823,7 @@ extern rtx const_tiny_rtx[3][(int) MAX_MACHINE_MODE];
    go through these unique rtx objects.  */
 extern rtx stack_pointer_rtx;
 extern rtx frame_pointer_rtx;
+extern rtx hard_frame_pointer_rtx;
 extern rtx arg_pointer_rtx;
 extern rtx pic_offset_table_rtx;
 extern rtx struct_value_rtx;
@@ -837,6 +831,16 @@ extern rtx struct_value_incoming_rtx;
 extern rtx static_chain_rtx;
 extern rtx static_chain_incoming_rtx;
 
+/* If HARD_FRAME_POINTER_REGNUM is defined, then a special dummy reg
+   is used to represent the frame pointer.  This is because the
+   hard frame pointer and the automatic variables are separated by an amount
+   that cannot be determined until after register allocation.  We can assume
+   that in this case ELIMINABLE_REGS will be defined, one action of which
+   will be to eliminate FRAME_POINTER_REGNUM into HARD_FRAME_POINTER_REGNUM. */
+#ifndef HARD_FRAME_POINTER_REGNUM
+#define HARD_FRAME_POINTER_REGNUM FRAME_POINTER_REGNUM
+#endif
+
 /* Virtual registers are used during RTL generation to refer to locations into
    the stack frame when the actual location isn't known until RTL generation
    is complete.  The routine instantiate_virtual_regs replaces these with
@@ -886,20 +890,14 @@ extern rtx *find_single_use               PROTO((rtx, rtx, rtx *));
    expr.h to be included for the enumeration.  */
 
 extern rtx expand_expr ();
-extern rtx immed_real_const_1();
 
-#ifdef TREE_CODE
-/* rtl.h and tree.h were included.  */
-extern rtx  output_constant_def PROTO((tree));
-extern rtx  immed_real_const   PROTO((tree));
-extern rtx  immed_real_const_1 PROTO((REAL_VALUE_TYPE, enum machine_mode));
-extern tree make_tree          PROTO((tree, rtx));
+extern rtx output_constant_def         PROTO((union tree_node *));
+extern rtx immed_real_const            PROTO((union tree_node *));
+extern union tree_node *make_tree      PROTO((union tree_node *, rtx));
 
-#else
-extern rtx output_constant_def ();
-extern rtx immed_real_const ();
-extern rtx immed_real_const_1 ();
-#endif
+/* Abort routines */
+extern void fatal_insn_not_found       PROTO((rtx));
+extern void fatal_insn                 PROTO((char *, rtx));
 
 /* Define a default value for STORE_FLAG_VALUE.  */
 
@@ -929,6 +927,13 @@ extern int cse_not_expected;
    Allocated in parallel with regno_pointer_flag.  */
 extern rtx *regno_reg_rtx;
 
+/* Vector indexed by regno; contains the alignment in bytes for a
+   register that contains a pointer, if known.  */
+extern char *regno_pointer_align;
+#define REGNO_POINTER_ALIGN(REGNO) regno_pointer_align[REGNO]
+
 /* Translates rtx code to tree code, for those codes needed by
-   REAL_ARITHMETIC.  */
-extern int rtx_to_tree_code ();
+   REAL_ARITHMETIC.  The function returns an int because the caller may not
+   know what `enum tree_code' means.  */
+
+extern int rtx_to_tree_code    PROTO((enum rtx_code));