X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=gcc%2Frtl.h;h=b9399f87c58a2f45bce2ed6722abff1788831392;hb=9a6e938f716d9f979fd79c907a6dbbdf2b858f65;hp=5cd651c60605d38d905cda29f75f415f99808b9a;hpb=0334f35ce975b4b82a5efa9559739cd2d4c98eef;p=pf3gnuchains%2Fgcc-fork.git diff --git a/gcc/rtl.h b/gcc/rtl.h index 5cd651c6060..b9399f87c58 100644 --- a/gcc/rtl.h +++ b/gcc/rtl.h @@ -1,6 +1,7 @@ /* Register Transfer Language (RTL) definitions for GCC - Copyright (C) 1987, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 1987, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, + 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 + Free Software Foundation, Inc. This file is part of GCC. @@ -26,6 +27,7 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA #include "machmode.h" #include "input.h" #include "real.h" +#include "vec.h" #undef FFS /* Some systems predefine this symbol; don't let it interfere. */ #undef FLOAT /* Likewise. */ @@ -104,7 +106,7 @@ extern const char * const rtx_format[NUM_RTX_CODE]; extern const enum rtx_class rtx_class[NUM_RTX_CODE]; #define GET_RTX_CLASS(CODE) (rtx_class[(int) (CODE)]) -extern const unsigned char rtx_size[NUM_RTX_CODE]; +extern const unsigned char rtx_code_size[NUM_RTX_CODE]; extern const unsigned char rtx_next[NUM_RTX_CODE]; /* The flags and bitfields of an ADDR_DIFF_VEC. BASE is the base label @@ -171,9 +173,63 @@ union rtunion_def struct basic_block_def *rt_bb; mem_attrs *rt_mem; reg_attrs *rt_reg; + struct constant_descriptor_rtx *rt_constant; }; typedef union rtunion_def rtunion; +/* This structure remembers the position of a SYMBOL_REF within an + object_block structure. A SYMBOL_REF only provides this information + if SYMBOL_REF_HAS_BLOCK_INFO_P is true. */ +struct block_symbol GTY(()) { + /* The usual SYMBOL_REF fields. */ + rtunion GTY ((skip)) fld[3]; + + /* The block that contains this object. */ + struct object_block *block; + + /* The offset of this object from the start of its block. It is negative + if the symbol has not yet been assigned an offset. */ + HOST_WIDE_INT offset; +}; + +DEF_VEC_P(rtx); +DEF_VEC_ALLOC_P(rtx,heap); +DEF_VEC_ALLOC_P(rtx,gc); + +/* Describes a group of objects that are to be placed together in such + a way that their relative positions are known. */ +struct object_block GTY(()) +{ + /* The section in which these objects should be placed. */ + section *sect; + + /* The alignment of the first object, measured in bits. */ + unsigned int alignment; + + /* The total size of the objects, measured in bytes. */ + HOST_WIDE_INT size; + + /* The SYMBOL_REFs for each object. The vector is sorted in + order of increasing offset and the following conditions will + hold for each element X: + + SYMBOL_REF_HAS_BLOCK_INFO_P (X) + !SYMBOL_REF_ANCHOR_P (X) + SYMBOL_REF_BLOCK (X) == [address of this structure] + SYMBOL_REF_BLOCK_OFFSET (X) >= 0. */ + VEC(rtx,gc) *objects; + + /* All the anchor SYMBOL_REFs used to address these objects, sorted + in order of increasing offset, and then increasing TLS model. + The following conditions will hold for each element X in this vector: + + SYMBOL_REF_HAS_BLOCK_INFO_P (X) + SYMBOL_REF_ANCHOR_P (X) + SYMBOL_REF_BLOCK (X) == [address of this structure] + SYMBOL_REF_BLOCK_OFFSET (X) >= 0. */ + VEC(rtx,gc) *anchors; +}; + /* RTL expression ("rtx"). */ struct rtx_def GTY((chain_next ("RTX_NEXT (&%h)"), @@ -250,6 +306,7 @@ struct rtx_def GTY((chain_next ("RTX_NEXT (&%h)"), union u { rtunion fld[1]; HOST_WIDE_INT hwint[1]; + struct block_symbol block_sym; struct real_value rv; } GTY ((special ("rtx_def"), desc ("GET_CODE (&%0)"))) u; }; @@ -258,7 +315,7 @@ struct rtx_def GTY((chain_next ("RTX_NEXT (&%h)"), #define RTX_HDR_SIZE offsetof (struct rtx_def, u) /* The size in bytes of an rtx with code CODE. */ -#define RTX_SIZE(CODE) rtx_size[CODE] +#define RTX_CODE_SIZE(CODE) rtx_code_size[CODE] #define NULL_RTX (rtx) 0 @@ -305,6 +362,9 @@ struct rtvec_def GTY(()) { /* Predicate yielding nonzero iff X is an rtx for a memory location. */ #define MEM_P(X) (GET_CODE (X) == MEM) +/* Predicate yielding nonzero iff X is an rtx for a constant integer. */ +#define CONST_INT_P(X) (GET_CODE (X) == CONST_INT) + /* Predicate yielding nonzero iff X is a label insn. */ #define LABEL_P(X) (GET_CODE (X) == CODE_LABEL) @@ -470,6 +530,14 @@ struct rtvec_def GTY(()) { __LINE__, __FUNCTION__); \ &_rtx->u.rv; }) +#define BLOCK_SYMBOL_CHECK(RTX) __extension__ \ +({ rtx const _symbol = (RTX); \ + unsigned int flags = RTL_CHECKC1 (_symbol, 1, SYMBOL_REF).rt_int; \ + if ((flags & SYMBOL_FLAG_HAS_BLOCK_INFO) == 0) \ + rtl_check_failed_block_symbol (__FILE__, __LINE__, \ + __FUNCTION__); \ + &_symbol->u.block_sym; }) + extern void rtl_check_failed_bounds (rtx, int, const char *, int, const char *) ATTRIBUTE_NORETURN; @@ -488,6 +556,8 @@ extern void rtl_check_failed_code2 (rtx, enum rtx_code, enum rtx_code, extern void rtl_check_failed_code_mode (rtx, enum rtx_code, enum machine_mode, bool, const char *, int, const char *) ATTRIBUTE_NORETURN; +extern void rtl_check_failed_block_symbol (const char *, int, const char *) + ATTRIBUTE_NORETURN; extern void rtvec_check_failed_bounds (rtvec, int, const char *, int, const char *) ATTRIBUTE_NORETURN; @@ -504,6 +574,7 @@ extern void rtvec_check_failed_bounds (rtvec, int, const char *, int, #define XCMWINT(RTX, N, C, M) ((RTX)->u.hwint[N]) #define XCNMWINT(RTX, N, C, M) ((RTX)->u.hwint[N]) #define XCNMPRV(RTX, C, M) (&(RTX)->u.rv) +#define BLOCK_SYMBOL_CHECK(RTX) (&(RTX)->u.block_sym) #endif @@ -630,6 +701,7 @@ extern void rtl_check_failed_flag (const char *, rtx, const char *, #define X0CSELIB(RTX, N) (RTL_CHECK1 (RTX, N, '0').rt_cselib) #define X0MEMATTR(RTX, N) (RTL_CHECKC1 (RTX, N, MEM).rt_mem) #define X0REGATTR(RTX, N) (RTL_CHECKC1 (RTX, N, REG).rt_reg) +#define X0CONSTANT(RTX, N) (RTL_CHECK1 (RTX, N, '0').rt_constant) /* Access a '0' field with any type. */ #define X0ANY(RTX, N) RTL_CHECK1 (RTX, N, '0') @@ -669,13 +741,6 @@ extern void rtl_check_failed_flag (const char *, rtx, const char *, -1 means this instruction has not been recognized yet. */ #define INSN_CODE(INSN) XINT (INSN, 6) -/* Set up in flow.c; empty before then. - Holds a chain of INSN_LIST rtx's whose first operands point at - previous insns with direct data-flow connections to this one. - That means that those insns set variables whose next use is in this insn. - They are always in the same basic block as this insn. */ -#define LOG_LINKS(INSN) XEXP(INSN, 7) - #define RTX_FRAME_RELATED_P(RTX) \ (RTL_FLAG_CHECK5("RTX_FRAME_RELATED_P", (RTX), INSN, CALL_INSN, \ JUMP_INSN, BARRIER, SET)->frame_related) @@ -718,7 +783,7 @@ extern void rtl_check_failed_flag (const char *, rtx, const char *, chain pointer and the first operand is the REG being described. The mode field of the EXPR_LIST contains not a real machine mode but a value from enum reg_note. */ -#define REG_NOTES(INSN) XEXP(INSN, 8) +#define REG_NOTES(INSN) XEXP(INSN, 7) enum reg_note { @@ -745,7 +810,7 @@ extern const char * const reg_note_name[]; 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) XEXP(INSN, 9) +#define CALL_INSN_FUNCTION_USAGE(INSN) XEXP(INSN, 8) /* The label-number of a code-label. The assembler label is made from `L' and the label-number printed in decimal. @@ -761,35 +826,20 @@ extern const char * const reg_note_name[]; /* Opaque data. */ #define NOTE_DATA(INSN) RTL_CHECKC1 (INSN, 4, NOTE) #define NOTE_DELETED_LABEL_NAME(INSN) XCSTR (INSN, 4, NOTE) -#ifdef USE_MAPPED_LOCATION -#define NOTE_SOURCE_LOCATION(INSN) XCUINT (INSN, 5, NOTE) -#define NOTE_EXPANDED_LOCATION(XLOC, INSN) \ - (XLOC) = expand_location (NOTE_SOURCE_LOCATION (INSN)) -#define SET_INSN_DELETED(INSN) \ - (PUT_CODE (INSN, NOTE), NOTE_LINE_NUMBER (INSN) = NOTE_INSN_DELETED) -#else -#define NOTE_EXPANDED_LOCATION(XLOC, INSN) \ - ((XLOC).file = NOTE_SOURCE_FILE (INSN), \ - (XLOC).line = NOTE_LINE_NUMBER (INSN)) -#define NOTE_SOURCE_FILE(INSN) XCSTR (INSN, 4, NOTE) -#define SET_INSN_DELETED(INSN) \ - (PUT_CODE (INSN, NOTE), NOTE_SOURCE_FILE (INSN) = 0, \ - NOTE_LINE_NUMBER (INSN) = NOTE_INSN_DELETED) -#endif +#define SET_INSN_DELETED(INSN) set_insn_deleted (INSN); #define NOTE_BLOCK(INSN) XCTREE (INSN, 4, NOTE) #define NOTE_EH_HANDLER(INSN) XCINT (INSN, 4, NOTE) #define NOTE_BASIC_BLOCK(INSN) XCBBDEF (INSN, 4, NOTE) -#define NOTE_EXPECTED_VALUE(INSN) XCEXP (INSN, 4, NOTE) #define NOTE_VAR_LOCATION(INSN) XCEXP (INSN, 4, NOTE) /* In a NOTE that is a line number, this is the line number. Other kinds of NOTEs are identified by negative numbers here. */ -#define NOTE_LINE_NUMBER(INSN) XCINT (INSN, 5, NOTE) +#define NOTE_KIND(INSN) XCINT (INSN, 5, NOTE) /* Nonzero if INSN is a note marking the beginning of a basic block. */ #define NOTE_INSN_BASIC_BLOCK_P(INSN) \ (GET_CODE (INSN) == NOTE \ - && NOTE_LINE_NUMBER (INSN) == NOTE_INSN_BASIC_BLOCK) + && NOTE_KIND (INSN) == NOTE_INSN_BASIC_BLOCK) /* Variable declaration and the location of a variable. */ #define NOTE_VAR_LOCATION_DECL(INSN) (XCTREE (XCEXP (INSN, 4, NOTE), \ @@ -797,7 +847,7 @@ extern const char * const reg_note_name[]; #define NOTE_VAR_LOCATION_LOC(INSN) (XCEXP (XCEXP (INSN, 4, NOTE), \ 1, VAR_LOCATION)) -/* Codes that appear in the NOTE_LINE_NUMBER field for kinds of notes +/* Codes that appear in the NOTE_KIND field for kinds of notes that are not line numbers. These codes are all negative. Notice that we do not try to use zero here for any of @@ -808,9 +858,6 @@ extern const char * const reg_note_name[]; enum insn_note { - /* Keep all of these numbers negative. Adjust as needed. */ - NOTE_INSN_BIAS = -100, - #define DEF_INSN_NOTE(NAME) NAME, #include "insn-notes.def" #undef DEF_INSN_NOTE @@ -820,9 +867,9 @@ enum insn_note /* Names for NOTE insn's other than line numbers. */ -extern const char * const note_insn_name[NOTE_INSN_MAX - NOTE_INSN_BIAS]; +extern const char * const note_insn_name[NOTE_INSN_MAX]; #define GET_NOTE_INSN_NAME(NOTE_CODE) \ - (note_insn_name[(NOTE_CODE) - (int) NOTE_INSN_BIAS]) + (note_insn_name[(NOTE_CODE)]) /* The name of a label, in case it corresponds to an explicit label in the input source code. */ @@ -885,28 +932,32 @@ enum label_kind /* 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. */ -#define JUMP_LABEL(INSN) XCEXP (INSN, 9, JUMP_INSN) +#define JUMP_LABEL(INSN) XCEXP (INSN, 8, JUMP_INSN) -/* Once basic blocks are found in flow.c, - each CODE_LABEL starts a chain that goes through - all the LABEL_REFs that jump to that label. - The chain eventually winds up at the CODE_LABEL: it is circular. */ +/* Once basic blocks are found, each CODE_LABEL starts a chain that + goes through all the LABEL_REFs that jump to that label. The chain + eventually winds up at the CODE_LABEL: it is circular. */ #define LABEL_REFS(LABEL) XCEXP (LABEL, 5, CODE_LABEL) -/* This is the field in the LABEL_REF through which the circular chain - of references to a particular label is linked. - FIXME: This chain is used in loop.c and in the SH backend. - Since loop.c is about to go away, it could be a win to replace - the uses of this in the SH backend with something else. */ -#define LABEL_NEXTREF(REF) XCEXP (REF, 1, LABEL_REF) - -/* For a REG rtx, REGNO extracts the register number. ORIGINAL_REGNO holds - the number the register originally had; for a pseudo register turned into - a hard reg this will hold the old pseudo register number. */ - -#define REGNO(RTX) XCUINT (RTX, 0, REG) +/* For a REG rtx, REGNO extracts the register number. REGNO can only + be used on RHS. Use SET_REGNO to change the value. */ +#define REGNO(RTX) (rhs_regno(RTX)) +#define SET_REGNO(RTX,N) (df_ref_change_reg_with_loc (REGNO(RTX), N, RTX), XCUINT (RTX, 0, REG) = N) + +/* ORIGINAL_REGNO holds the number the register originally had; for a + pseudo register turned into a hard reg this will hold the old pseudo + register number. */ #define ORIGINAL_REGNO(RTX) X0UINT (RTX, 1) +/* Force the REGNO macro to only be used on the lhs. */ +static inline unsigned int +rhs_regno (rtx x) +{ + return XCUINT (x, 0, REG); +} + + + /* 1 if RTX is a reg or parallel that is the current function's return value. */ #define REG_FUNCTION_VALUE_P(RTX) \ @@ -932,6 +983,7 @@ enum label_kind /* For a CONST_INT rtx, INTVAL extracts the integer. */ #define INTVAL(RTX) XCWINT(RTX, 0, CONST_INT) +#define UINTVAL(RTX) ((unsigned HOST_WIDE_INT) INTVAL (RTX)) /* For a CONST_DOUBLE: For a VOIDmode, there are two integers CONST_DOUBLE_LOW is the @@ -976,8 +1028,11 @@ extern unsigned int subreg_regno_offset (unsigned int, enum machine_mode, extern bool subreg_offset_representable_p (unsigned int, enum machine_mode, unsigned int, enum machine_mode); extern unsigned int subreg_regno (rtx); +extern unsigned int subreg_nregs (rtx); extern unsigned HOST_WIDE_INT nonzero_bits (rtx, enum machine_mode); extern unsigned int num_sign_bit_copies (rtx, enum machine_mode); +extern bool constant_pool_constant_p (rtx); +extern bool truncated_to_mode (enum machine_mode, rtx); /* 1 if RTX is a subreg containing a reg that is already known to be @@ -1022,9 +1077,12 @@ do { \ GET_MODE (XCVECEXP (RTX, 4, N, ASM_OPERANDS)) #ifdef USE_MAPPED_LOCATION #define ASM_OPERANDS_SOURCE_LOCATION(RTX) XCUINT (RTX, 5, ASM_OPERANDS) +#define ASM_INPUT_SOURCE_LOCATION(RTX) XCUINT (RTX, 1, ASM_INPUT) #else #define ASM_OPERANDS_SOURCE_FILE(RTX) XCSTR (RTX, 5, ASM_OPERANDS) #define ASM_OPERANDS_SOURCE_LINE(RTX) XCINT (RTX, 6, ASM_OPERANDS) +#define ASM_INPUT_SOURCE_FILE(RTX) XCSTR (RTX, 1, ASM_INPUT) +#define ASM_INPUT_SOURCE_LINE(RTX) XCINT (RTX, 2, ASM_INPUT) #endif /* 1 if RTX is a mem that is statically allocated in read-only memory. */ @@ -1129,13 +1187,9 @@ do { \ MEM_NOTRAP_P (LHS) = MEM_NOTRAP_P (RHS), \ MEM_READONLY_P (LHS) = MEM_READONLY_P (RHS), \ MEM_KEEP_ALIAS_SET_P (LHS) = MEM_KEEP_ALIAS_SET_P (RHS), \ + MEM_POINTER (LHS) = MEM_POINTER (RHS), \ MEM_ATTRS (LHS) = MEM_ATTRS (RHS)) -/* 1 if RTX is a label_ref to a label outside the loop containing the - reference. */ -#define LABEL_OUTSIDE_LOOP_P(RTX) \ - (RTL_FLAG_CHECK1("LABEL_OUTSIDE_LOOP_P", (RTX), LABEL_REF)->in_struct) - /* 1 if RTX is a label_ref for a nonlocal label. */ /* Likewise in an expr_list for a reg_label note. */ #define LABEL_REF_NONLOCAL_P(RTX) \ @@ -1193,8 +1247,26 @@ do { \ #define SYMBOL_REF_WEAK(RTX) \ (RTL_FLAG_CHECK1("SYMBOL_REF_WEAK", (RTX), SYMBOL_REF)->return_val) +/* A pointer attached to the SYMBOL_REF; either SYMBOL_REF_DECL or + SYMBOL_REF_CONSTANT. */ +#define SYMBOL_REF_DATA(RTX) X0ANY ((RTX), 2) + +/* Set RTX's SYMBOL_REF_DECL to DECL. RTX must not be a constant + pool symbol. */ +#define SET_SYMBOL_REF_DECL(RTX, DECL) \ + (gcc_assert (!CONSTANT_POOL_ADDRESS_P (RTX)), X0TREE ((RTX), 2) = (DECL)) + /* The tree (decl or constant) associated with the symbol, or null. */ -#define SYMBOL_REF_DECL(RTX) X0TREE ((RTX), 2) +#define SYMBOL_REF_DECL(RTX) \ + (CONSTANT_POOL_ADDRESS_P (RTX) ? NULL : X0TREE ((RTX), 2)) + +/* Set RTX's SYMBOL_REF_CONSTANT to C. RTX must be a constant pool symbol. */ +#define SET_SYMBOL_REF_CONSTANT(RTX, C) \ + (gcc_assert (CONSTANT_POOL_ADDRESS_P (RTX)), X0CONSTANT ((RTX), 2) = (C)) + +/* The rtx constant pool entry for a symbol, or null. */ +#define SYMBOL_REF_CONSTANT(RTX) \ + (CONSTANT_POOL_ADDRESS_P (RTX) ? X0CONSTANT ((RTX), 2) : NULL) /* A set of flags on a symbol_ref that are, in some respects, redundant with information derivable from the tree decl associated with this symbol. @@ -1229,15 +1301,45 @@ do { \ #define SYMBOL_FLAG_EXTERNAL (1 << 6) #define SYMBOL_REF_EXTERNAL_P(RTX) \ ((SYMBOL_REF_FLAGS (RTX) & SYMBOL_FLAG_EXTERNAL) != 0) +/* Set if this symbol has a block_symbol structure associated with it. */ +#define SYMBOL_FLAG_HAS_BLOCK_INFO (1 << 7) +#define SYMBOL_REF_HAS_BLOCK_INFO_P(RTX) \ + ((SYMBOL_REF_FLAGS (RTX) & SYMBOL_FLAG_HAS_BLOCK_INFO) != 0) +/* Set if this symbol is a section anchor. SYMBOL_REF_ANCHOR_P implies + SYMBOL_REF_HAS_BLOCK_INFO_P. */ +#define SYMBOL_FLAG_ANCHOR (1 << 8) +#define SYMBOL_REF_ANCHOR_P(RTX) \ + ((SYMBOL_REF_FLAGS (RTX) & SYMBOL_FLAG_ANCHOR) != 0) /* Subsequent bits are available for the target to use. */ -#define SYMBOL_FLAG_MACH_DEP_SHIFT 7 +#define SYMBOL_FLAG_MACH_DEP_SHIFT 9 #define SYMBOL_FLAG_MACH_DEP (1 << SYMBOL_FLAG_MACH_DEP_SHIFT) +/* If SYMBOL_REF_HAS_BLOCK_INFO_P (RTX), this is the object_block + structure to which the symbol belongs, or NULL if it has not been + assigned a block. */ +#define SYMBOL_REF_BLOCK(RTX) (BLOCK_SYMBOL_CHECK (RTX)->block) + +/* If SYMBOL_REF_HAS_BLOCK_INFO_P (RTX), this is the offset of RTX from + the first object in SYMBOL_REF_BLOCK (RTX). The value is negative if + RTX has not yet been assigned to a block, or it has not been given an + offset within that block. */ +#define SYMBOL_REF_BLOCK_OFFSET(RTX) (BLOCK_SYMBOL_CHECK (RTX)->offset) + +/* Indicate whether the machine has any sort of auto increment addressing. + If not, we can avoid checking for REG_INC notes. */ + +#if (defined (HAVE_PRE_INCREMENT) || defined (HAVE_PRE_DECREMENT) \ + || defined (HAVE_POST_INCREMENT) || defined (HAVE_POST_DECREMENT) \ + || defined (HAVE_PRE_MODIFY_DISP) || defined (HAVE_PRE_MODIFY_DISP) \ + || defined (HAVE_PRE_MODIFY_REG) || defined (HAVE_POST_MODIFY_REG)) +#define AUTO_INC_DEC +#endif + /* Define a macro to look for REG_INC notes, but save time on machines where they never exist. */ -#if (defined (HAVE_PRE_INCREMENT) || defined (HAVE_PRE_DECREMENT) || defined (HAVE_POST_INCREMENT) || defined (HAVE_POST_DECREMENT)) +#ifdef AUTO_INC_DEC #define FIND_REG_INC_NOTE(INSN, REG) \ ((REG) != NULL_RTX && REG_P ((REG)) \ ? find_regno_note ((INSN), REG_INC, REGNO (REG)) \ @@ -1246,13 +1348,6 @@ do { \ #define FIND_REG_INC_NOTE(INSN, REG) 0 #endif -/* Indicate whether the machine has any sort of auto increment addressing. - If not, we can avoid checking for REG_INC notes. */ - -#if (defined (HAVE_PRE_INCREMENT) || defined (HAVE_PRE_DECREMENT) || defined (HAVE_POST_INCREMENT) || defined (HAVE_POST_DECREMENT)) -#define AUTO_INC_DEC -#endif - #ifndef HAVE_PRE_INCREMENT #define HAVE_PRE_INCREMENT 0 #endif @@ -1333,15 +1428,13 @@ extern int currently_expanding_to_rtl; /* In expmed.c */ extern int ceil_log2 (unsigned HOST_WIDE_INT); -/* In builtins.c */ -extern rtx expand_builtin_expect_jump (tree, rtx, rtx); - /* In explow.c */ extern void set_stack_check_libfunc (rtx); extern HOST_WIDE_INT trunc_int_for_mode (HOST_WIDE_INT, enum machine_mode); extern rtx plus_constant (rtx, HOST_WIDE_INT); /* In emit-rtl.c */ +extern rtx gen_blockage (void); extern rtvec gen_rtvec (int, ...); extern rtx copy_insn_1 (rtx); extern rtx copy_insn (rtx); @@ -1357,6 +1450,7 @@ extern rtx rtx_alloc_stat (RTX_CODE MEM_STAT_DECL); #define rtx_alloc(c) rtx_alloc_stat (c MEM_STAT_INFO) extern rtvec rtvec_alloc (int); +extern bool shared_const_p (rtx); extern rtx copy_rtx (rtx); extern void dump_rtx_statistics (void); @@ -1364,6 +1458,7 @@ extern void dump_rtx_statistics (void); extern rtx copy_rtx_if_shared (rtx); /* In rtl.c */ +extern unsigned int rtx_size (rtx); extern rtx shallow_copy_rtx_stat (rtx MEM_STAT_DECL); #define shallow_copy_rtx(a) shallow_copy_rtx_stat (a MEM_STAT_INFO) extern int rtx_equal_p (rtx, rtx); @@ -1372,6 +1467,7 @@ extern int rtx_equal_p (rtx, rtx); extern rtvec gen_rtvec_v (int, rtx *); extern rtx gen_reg_rtx (enum machine_mode); extern rtx gen_rtx_REG_offset (rtx, enum machine_mode, unsigned int, int); +extern rtx gen_reg_rtx_offset (rtx, enum machine_mode, int); extern rtx gen_label_rtx (void); extern rtx gen_lowpart_common (enum machine_mode, rtx); @@ -1400,6 +1496,7 @@ extern rtx get_first_nonnote_insn (void); extern rtx get_last_nonnote_insn (void); extern void start_sequence (void); extern void push_to_sequence (rtx); +extern void push_to_sequence2 (rtx, rtx); extern void end_sequence (void); extern rtx immed_double_const (HOST_WIDE_INT, HOST_WIDE_INT, enum machine_mode); @@ -1417,7 +1514,6 @@ struct function; extern rtx get_pool_constant (rtx); extern rtx get_pool_constant_mark (rtx, bool *); extern enum machine_mode get_pool_mode (rtx); -extern rtx get_pool_constant_for_function (struct function *, rtx); extern rtx simplify_subtraction (rtx); /* In function.c */ @@ -1429,7 +1525,7 @@ extern rtx assign_temp (tree, int, int, int); /* In emit-rtl.c */ extern rtx emit_insn_before (rtx, rtx); -extern rtx emit_insn_before_noloc (rtx, rtx); +extern rtx emit_insn_before_noloc (rtx, rtx, struct basic_block_def *); extern rtx emit_insn_before_setloc (rtx, rtx, int); extern rtx emit_jump_insn_before (rtx, rtx); extern rtx emit_jump_insn_before_noloc (rtx, rtx); @@ -1439,9 +1535,9 @@ extern rtx emit_call_insn_before_noloc (rtx, rtx); extern rtx emit_call_insn_before_setloc (rtx, rtx, int); extern rtx emit_barrier_before (rtx); extern rtx emit_label_before (rtx, rtx); -extern rtx emit_note_before (int, rtx); +extern rtx emit_note_before (enum insn_note, rtx); extern rtx emit_insn_after (rtx, rtx); -extern rtx emit_insn_after_noloc (rtx, rtx); +extern rtx emit_insn_after_noloc (rtx, rtx, struct basic_block_def *); extern rtx emit_insn_after_setloc (rtx, rtx, int); extern rtx emit_jump_insn_after (rtx, rtx); extern rtx emit_jump_insn_after_noloc (rtx, rtx); @@ -1451,16 +1547,14 @@ extern rtx emit_call_insn_after_noloc (rtx, rtx); extern rtx emit_call_insn_after_setloc (rtx, rtx, int); extern rtx emit_barrier_after (rtx); extern rtx emit_label_after (rtx, rtx); -extern rtx emit_note_after (int, rtx); -extern rtx emit_note_copy_after (rtx, rtx); +extern rtx emit_note_after (enum insn_note, rtx); extern rtx emit_insn (rtx); extern rtx emit_jump_insn (rtx); extern rtx emit_call_insn (rtx); extern rtx emit_label (rtx); extern rtx emit_barrier (void); -extern rtx emit_note (int); +extern rtx emit_note (enum insn_note); extern rtx emit_note_copy (rtx); -extern rtx emit_line_note (location_t); extern rtx make_insn_raw (rtx); extern rtx make_jump_insn_raw (rtx); extern void add_function_usage_to (rtx, rtx); @@ -1494,15 +1588,10 @@ extern enum rtx_code swap_condition (enum rtx_code); extern enum rtx_code unsigned_condition (enum rtx_code); extern enum rtx_code signed_condition (enum rtx_code); extern void mark_jump_label (rtx, rtx, int); -extern void cleanup_barriers (void); +extern unsigned int cleanup_barriers (void); /* In jump.c */ -extern bool squeeze_notes (rtx *, rtx *); extern rtx delete_related_insns (rtx); -extern void delete_jump (rtx); -extern rtx get_label_before (rtx); -extern rtx get_label_after (rtx); -extern rtx follow_jumps (rtx); /* In recog.c */ extern rtx *find_constant_term_loc (rtx *); @@ -1543,7 +1632,6 @@ extern rtx simplify_gen_subreg (enum machine_mode, rtx, enum machine_mode, extern rtx simplify_replace_rtx (rtx, rtx, rtx); extern rtx simplify_rtx (rtx); extern rtx avoid_constant_pool_reference (rtx); -extern bool constant_pool_reference_p (rtx x); extern bool mode_signbit_p (enum machine_mode, rtx); /* In regclass.c */ @@ -1552,6 +1640,7 @@ extern enum machine_mode choose_hard_reg_mode (unsigned int, unsigned int, /* In emit-rtl.c */ extern rtx set_unique_reg_note (rtx, enum reg_note, rtx); +extern void set_insn_deleted (rtx); /* Functions in rtlanal.c */ @@ -1577,7 +1666,8 @@ extern int rtx_varies_p (rtx, int); extern int rtx_addr_varies_p (rtx, int); extern HOST_WIDE_INT get_integer_term (rtx); extern rtx get_related_value (rtx); -extern int global_reg_mentioned_p (rtx); +extern bool offset_within_block_p (rtx, HOST_WIDE_INT); +extern void split_const (rtx, rtx *, rtx *); extern int reg_mentioned_p (rtx, rtx); extern int count_occurrences (rtx, rtx, int); extern int reg_referenced_p (rtx, rtx); @@ -1604,18 +1694,20 @@ extern int dead_or_set_regno_p (rtx, unsigned int); extern rtx find_reg_note (rtx, enum reg_note, rtx); extern rtx find_regno_note (rtx, enum reg_note, unsigned int); extern rtx find_reg_equal_equiv_note (rtx); +extern rtx find_constant_src (rtx); extern int find_reg_fusage (rtx, enum rtx_code, rtx); extern int find_regno_fusage (rtx, enum rtx_code, unsigned int); extern int pure_call_p (rtx); extern void remove_note (rtx, rtx); +extern void remove_reg_equal_equiv_notes (rtx); extern int side_effects_p (rtx); extern int volatile_refs_p (rtx); extern int volatile_insn_p (rtx); extern int may_trap_p (rtx); +extern int may_trap_after_code_motion_p (rtx); extern int may_trap_or_fault_p (rtx); extern int inequality_comparisons_p (rtx); extern rtx replace_rtx (rtx, rtx, rtx); -extern rtx replace_regs (rtx, rtx *, unsigned int, int); extern int replace_label (rtx *, void *); extern int rtx_referenced_p (rtx, rtx); extern bool tablejump_p (rtx, rtx *, rtx *); @@ -1626,7 +1718,6 @@ extern rtx regno_use_in (unsigned int, rtx); extern int auto_inc_p (rtx); extern int in_expr_list_p (rtx, rtx); extern void remove_node_from_expr_list (rtx, rtx *); -extern int insns_safe_to_move_p (rtx, rtx, rtx *); extern int loc_mentioned_in_p (rtx *, rtx); extern rtx find_first_parameter_load (rtx, rtx); extern bool keep_with_call_p (rtx); @@ -1641,11 +1732,6 @@ extern rtx canonicalize_condition (rtx, rtx, int, rtx *, rtx, int, int); being made. */ extern rtx get_condition (rtx, rtx *, int, int); - -/* flow.c */ - -extern rtx find_use_as_address (rtx, rtx, HOST_WIDE_INT); - /* lists.c */ void free_EXPR_LIST_list (rtx *); @@ -1654,28 +1740,24 @@ void free_EXPR_LIST_node (rtx); void free_INSN_LIST_node (rtx); rtx alloc_INSN_LIST (rtx, rtx); rtx alloc_EXPR_LIST (int, rtx, rtx); +void remove_free_INSN_LIST_elem (rtx, rtx *); +rtx remove_list_elem (rtx, rtx *); /* regclass.c */ -/* Maximum number of parallel sets and clobbers in any insn in this fn. - Always at least 3, since the combiner could put that many together - and we want this to remain correct for all the remaining passes. */ - -extern int max_parallel; - /* Free up register info memory. */ extern void free_reg_info (void); /* recog.c */ extern int asm_noperands (rtx); extern const char *decode_asm_operands (rtx, rtx *, rtx **, const char **, - enum machine_mode *); + enum machine_mode *, location_t *); extern enum reg_class reg_preferred_class (int); extern enum reg_class reg_alternate_class (int); -extern void split_all_insns (int); -extern void split_all_insns_noflow (void); +extern void split_all_insns (void); +extern unsigned int split_all_insns_noflow (void); #define MAX_SAVED_CONST_INT 64 extern GTY(()) rtx const_int_rtx[MAX_SAVED_CONST_INT * 2 + 1]; @@ -1766,7 +1848,17 @@ extern GTY(()) rtx return_address_pointer_rtx; #ifndef GENERATOR_FILE #include "genrtl.h" -#ifndef USE_MAPPED_LOCATION +#undef gen_rtx_ASM_INPUT +#ifdef USE_MAPPED_LOCATION +#define gen_rtx_ASM_INPUT(MODE, ARG0) \ + gen_rtx_fmt_si (ASM_INPUT, (MODE), (ARG0), 0) +#define gen_rtx_ASM_INPUT_loc(MODE, ARG0, LOC) \ + gen_rtx_fmt_si (ASM_INPUT, (MODE), (ARG0), (LOC)) +#else +#define gen_rtx_ASM_INPUT(MODE, ARG0) \ + gen_rtx_fmt_ssi (ASM_INPUT, (MODE), (ARG0), "", 0) +#define gen_rtx_ASM_INPUT_loc(MODE, ARG0, LOC) \ + gen_rtx_fmt_ssi (ASM_INPUT, (MODE), (ARG0), (LOC).file, (LOC).line) #undef gen_rtx_ASM_OPERANDS #define gen_rtx_ASM_OPERANDS(MODE, ARG0, ARG1, ARG2, ARG3, ARG4, LOC) \ gen_rtx_fmt_ssiEEsi (ASM_OPERANDS, (MODE), (ARG0), (ARG1), (ARG2), (ARG3), (ARG4), (LOC).file, (LOC).line) @@ -1853,10 +1945,6 @@ extern rtx gen_rtx_MEM (enum machine_mode, rtx); extern rtx output_constant_def (tree, int); extern rtx lookup_constant_def (tree); -/* Nonzero after the second flow pass has completed. - Set to 1 or 0 by toplev.c */ -extern int flow2_completed; - /* Nonzero after end of reload pass. Set to 1 or 0 by reload1.c. */ @@ -1870,6 +1958,12 @@ extern int epilogue_completed; extern int reload_in_progress; +#ifdef STACK_REGS +/* Nonzero after end of regstack pass. + Set to 1 or 0 by reg-stack.c. */ +extern int regstack_completed; +#endif + /* If this is nonzero, we do not bother generating VOLATILE around volatile memory references, and we are willing to output indirect addresses. If cse is to follow, we reject @@ -1890,7 +1984,7 @@ extern int rtx_to_tree_code (enum rtx_code); /* In cse.c */ extern int delete_trivially_dead_insns (rtx, int); -extern int cse_main (rtx, int, FILE *); +extern int cse_main (rtx, int); extern int exp_equiv_p (rtx, rtx, int, bool); extern unsigned hash_rtx (rtx x, enum machine_mode, int *, int *, bool); @@ -1921,7 +2015,6 @@ extern enum rtx_code reversed_comparison_code_parts (enum rtx_code, rtx, rtx, rtx); extern void delete_for_peephole (rtx, rtx); extern int condjump_in_parallel_p (rtx); -extern void purge_line_number_notes (void); /* In emit-rtl.c. */ extern int max_reg_num (void); @@ -1943,7 +2036,7 @@ extern void init_emit_once (int); extern void push_topmost_sequence (void); extern void pop_topmost_sequence (void); extern void set_new_first_and_last_insn (rtx, rtx); -extern void unshare_all_rtl (void); +extern unsigned int unshare_all_rtl (void); extern void unshare_all_rtl_again (rtx); extern void unshare_all_rtl_in_chain (rtx); extern void verify_rtl_sharing (void); @@ -1951,16 +2044,14 @@ extern void set_first_insn (rtx); extern void set_last_insn (rtx); extern void link_cc0_insns (rtx); extern void add_insn (rtx); -extern void add_insn_before (rtx, rtx); -extern void add_insn_after (rtx, rtx); +extern void add_insn_before (rtx, rtx, struct basic_block_def *); +extern void add_insn_after (rtx, rtx, struct basic_block_def *); extern void remove_insn (rtx); -extern void emit_insn_after_with_line_notes (rtx, rtx, rtx); extern rtx emit (rtx); -extern void renumber_insns (FILE *); -extern void remove_unnecessary_notes (void); extern rtx delete_insn (rtx); extern rtx entry_of_function (void); -extern void delete_insn_chain (rtx, rtx); +extern void emit_insn_at_entry (rtx); +extern void delete_insn_chain (rtx, rtx, bool); extern rtx unlink_insn_chain (rtx, rtx); extern rtx delete_insn_and_edges (rtx); extern void delete_insn_chain_and_edges (rtx, rtx); @@ -1971,17 +2062,25 @@ extern rtx gen_tmp_stack_mem (enum machine_mode, rtx); extern bool validate_subreg (enum machine_mode, enum machine_mode, rtx, unsigned int); -/* In combine.c */ +/* In combine.c */ extern unsigned int extended_count (rtx, enum machine_mode, int); extern rtx remove_death (unsigned int, rtx); extern void dump_combine_stats (FILE *); extern void dump_combine_total_stats (FILE *); +/* In cfgcleanup.c */ +extern void delete_dead_jumptables (void); + +/* In sched-vis.c. */ +extern void print_rtl_slim_with_bb (FILE *, rtx, int); +extern void dump_insn_slim (FILE *f, rtx x); +extern void debug_insn_slim (rtx x); + /* In sched-rgn.c. */ -extern void schedule_insns (FILE *); +extern void schedule_insns (void); /* In sched-ebb.c. */ -extern void schedule_ebbs (FILE *); +extern void schedule_ebbs (void); /* In haifa-sched.c. */ extern void fix_sched_param (const char *, const char *); @@ -1998,15 +2097,8 @@ extern void print_simple_rtl (FILE *, rtx); extern int print_rtl_single (FILE *, rtx); extern void print_inline_rtx (FILE *, rtx, int); -/* In loop.c */ -extern void init_loop (void); - -/* In bt-load.c */ -extern void branch_target_load_optimize (bool); - /* In function.c */ -extern void reposition_prologue_and_epilogue_notes (rtx); -extern void thread_prologue_and_epilogue_insns (rtx); +extern void reposition_prologue_and_epilogue_notes (void); extern int prologue_epilogue_contains (rtx); extern int sibcall_epilogue_contains (rtx); extern void mark_temp_addr_taken (rtx); @@ -2021,12 +2113,12 @@ extern void emit_jump (rtx); extern rtx move_by_pieces (rtx, rtx, unsigned HOST_WIDE_INT, unsigned int, int); -/* In flow.c */ -extern void recompute_reg_usage (void); -extern int initialize_uninitialized_subregs (void); -extern void delete_dead_jumptables (void); +/* In cfgrtl.c */ extern void print_rtl_with_bb (FILE *, rtx); -extern void dump_flow_info (FILE *); + +/* In cfg.c. */ +extern void dump_reg_info (FILE *); +extern void dump_flow_info (FILE *, int); /* In expmed.c */ extern void init_expmed (void); @@ -2037,9 +2129,6 @@ extern void expand_dec (rtx, rtx); extern bool can_copy_p (enum machine_mode); extern rtx fis_get_condition (rtx); -/* In postreload-gcse.c */ -extern void gcse_after_reload_main (rtx); - /* In global.c */ extern void mark_elimination (int, int); extern void dump_global_regs (FILE *); @@ -2057,13 +2146,9 @@ extern void init_reg_modes_once (void); extern void init_regs (void); extern void init_fake_stack_mems (void); extern void init_reg_sets (void); -extern void regclass_init (void); -extern void regclass (rtx, int, FILE *); +extern void regclass (rtx, int); extern void reg_scan (rtx, unsigned int); -extern void reg_scan_update (rtx, rtx, unsigned int); extern void fix_register (const char *, int, int); -extern void init_subregs_of_mode (void); -extern void record_subregs_of_mode (rtx); #ifdef HARD_CONST extern void cannot_change_mode_set_regs (HARD_REG_SET *, enum machine_mode, unsigned int); @@ -2071,12 +2156,8 @@ extern void cannot_change_mode_set_regs (HARD_REG_SET *, extern bool invalid_mode_change_p (unsigned int, enum reg_class, enum machine_mode); -/* In regmove.c */ -extern void regmove_optimize (rtx, int, FILE *); -extern void combine_stack_adjustments (void); - /* In reorg.c */ -extern void dbr_schedule (rtx, FILE *); +extern void dbr_schedule (rtx); /* In local-alloc.c */ extern void dump_local_alloc (FILE *); @@ -2084,9 +2165,6 @@ extern void dump_local_alloc (FILE *); /* In reload1.c */ extern int function_invariant_p (rtx); -/* In reg-stack.c */ -extern bool reg_to_stack (FILE *); - /* In calls.c */ enum libcall_type { @@ -2124,7 +2202,6 @@ extern const char *read_rtx_filename; extern int read_rtx_lineno; /* In alias.c */ -extern void clear_reg_alias_info (rtx); extern rtx canon_rtx (rtx); extern int true_dependence (rtx, enum machine_mode, rtx, int (*)(rtx, int)); extern rtx get_addr (rtx); @@ -2133,7 +2210,6 @@ extern int canon_true_dependence (rtx, enum machine_mode, rtx, rtx, extern int read_dependence (rtx, rtx); extern int anti_dependence (rtx, rtx); extern int output_dependence (rtx, rtx); -extern void mark_constant_function (void); extern void init_alias_once (void); extern void init_alias_analysis (void); extern void end_alias_analysis (void); @@ -2150,18 +2226,16 @@ extern int stack_regs_mentioned (rtx insn); /* In toplev.c */ extern GTY(()) rtx stack_limit_rtx; -/* In regrename.c */ -extern void regrename_optimize (void); -extern void copyprop_hardreg_forward (void); - /* In predict.c */ extern void invert_br_probabilities (rtx); extern bool expensive_function_p (int); +/* In cfgexpand.c */ +extern void add_reg_br_prob_note (rtx last, int probability); /* In tracer.c */ -extern void tracer (unsigned int); +extern void tracer (void); /* In var-tracking.c */ -extern void variable_tracking_main (void); +extern unsigned int variable_tracking_main (void); /* In stor-layout.c. */ extern void get_mode_bounds (enum machine_mode, int, enum machine_mode, @@ -2174,12 +2248,6 @@ extern rtx compare_and_jump_seq (rtx, rtx, enum rtx_code, rtx, int, rtx); /* In loop-iv.c */ extern rtx canon_condition (rtx); extern void simplify_using_condition (rtx, rtx *, struct bitmap_head_def *); - -/* In ra.c. */ -extern void reg_alloc (void); - -/* In modulo-sched.c. */ -extern void sms_schedule (FILE *); struct rtl_hooks { @@ -2189,8 +2257,9 @@ struct rtl_hooks unsigned HOST_WIDE_INT, unsigned HOST_WIDE_INT *); rtx (*reg_num_sign_bit_copies) (rtx, enum machine_mode, rtx, enum machine_mode, unsigned int, unsigned int *); + bool (*reg_truncated_to_mode) (enum machine_mode, rtx); - /* Whenever you add entries here, make sure you adjust hosthooks-def.h. */ + /* Whenever you add entries here, make sure you adjust rtlhooks-def.h. */ }; /* Each pass can provide its own. */ @@ -2202,4 +2271,10 @@ extern const struct rtl_hooks general_rtl_hooks; /* Keep this for the nonce. */ #define gen_lowpart rtl_hooks.gen_lowpart +extern void insn_locators_alloc (void); +extern void insn_locators_finalize (void); +extern void set_curr_insn_source_location (location_t); +extern void set_curr_insn_block (tree); +extern int curr_insn_locator (void); + #endif /* ! GCC_RTL_H */