Commit 5a63e069 by Janis Johnson Committed by Janis Johnson

rtl.h (struct rtx_def): Update comments.

	* rtl.h (struct rtx_def): Update comments.
	(RTL_FLAG_CHECK[12345678]): New.  (rtl_check_failed_flag): Declare.
	(RTL_FLAG): New.  (CLEAR_RTX_FLAGS): New.  (flag access macros): Use
	RTL_FLAG_CHECK macros with list of expected RTL codes.
	* rtl.c (copy_rtx, shallow_copy_rtx): Use RTX_FLAG macro.
	(rtl_check_failed_flag): New.
	* reload1.c (reload): Use REG macro before changing rtx to MEM.
	(reload_cse_noop_set_p): Check rtx code before using access macro.
	* config/ia64/ia64.c (process_for_unwind_directive): Check rtx code
	before using access macro.

From-SVN: r53245
parent 4afe3952
2002-05-06 Janis Johnson <janis187@us.ibm.com> 2002-05-06 Janis Johnson <janis187@us.ibm.com>
* rtl.h (struct rtx_def): Update comments.
(RTL_FLAG_CHECK[12345678]): New. (rtl_check_failed_flag): Declare.
(RTL_FLAG): New. (CLEAR_RTX_FLAGS): New. (flag access macros): Use
RTL_FLAG_CHECK macros with list of expected RTL codes.
* rtl.c (copy_rtx, shallow_copy_rtx): Use RTX_FLAG macro.
(rtl_check_failed_flag): New.
* reload1.c (reload): Use REG macro before changing rtx to MEM.
(reload_cse_noop_set_p): Check rtx code before using access macro.
* config/ia64/ia64.c (process_for_unwind_directive): Check rtx code
before using access macro.
2002-05-06 Janis Johnson <janis187@us.ibm.com>
* doc/rtl.texi (Flags): Update to reflect current usage. * doc/rtl.texi (Flags): Update to reflect current usage.
2002-05-06 Roger Sayle <roger@eyesopen.com> 2002-05-06 Roger Sayle <roger@eyesopen.com>
......
...@@ -7225,7 +7225,7 @@ process_for_unwind_directive (asm_out_file, insn) ...@@ -7225,7 +7225,7 @@ process_for_unwind_directive (asm_out_file, insn)
} }
} }
if (! RTX_FRAME_RELATED_P (insn)) if (GET_CODE (insn) == NOTE || ! RTX_FRAME_RELATED_P (insn))
return; return;
pat = find_reg_note (insn, REG_FRAME_RELATED_EXPR, NULL_RTX); pat = find_reg_note (insn, REG_FRAME_RELATED_EXPR, NULL_RTX);
......
...@@ -1160,9 +1160,9 @@ reload (first, global) ...@@ -1160,9 +1160,9 @@ reload (first, global)
{ {
rtx reg = regno_reg_rtx[i]; rtx reg = regno_reg_rtx[i];
REG_USERVAR_P (reg) = 0;
PUT_CODE (reg, MEM); PUT_CODE (reg, MEM);
XEXP (reg, 0) = addr; XEXP (reg, 0) = addr;
REG_USERVAR_P (reg) = 0;
if (reg_equiv_memory_loc[i]) if (reg_equiv_memory_loc[i])
MEM_COPY_ATTRIBUTES (reg, reg_equiv_memory_loc[i]); MEM_COPY_ATTRIBUTES (reg, reg_equiv_memory_loc[i]);
else else
...@@ -8079,7 +8079,8 @@ reload_cse_simplify (insn) ...@@ -8079,7 +8079,8 @@ reload_cse_simplify (insn)
if (!count && reload_cse_noop_set_p (body)) if (!count && reload_cse_noop_set_p (body))
{ {
rtx value = SET_DEST (body); rtx value = SET_DEST (body);
if (! REG_FUNCTION_VALUE_P (SET_DEST (body))) if (GET_CODE (body) == REG
&& ! REG_FUNCTION_VALUE_P (SET_DEST (body)))
value = 0; value = 0;
reload_cse_delete_noop_set (insn, value); reload_cse_delete_noop_set (insn, value);
return; return;
......
...@@ -331,13 +331,13 @@ copy_rtx (orig) ...@@ -331,13 +331,13 @@ copy_rtx (orig)
/* We do not copy the USED flag, which is used as a mark bit during /* We do not copy the USED flag, which is used as a mark bit during
walks over the RTL. */ walks over the RTL. */
copy->used = 0; RTX_FLAG (copy, used) = 0;
/* We do not copy FRAME_RELATED for INSNs. */ /* We do not copy FRAME_RELATED for INSNs. */
if (GET_RTX_CLASS (code) == 'i') if (GET_RTX_CLASS (code) == 'i')
copy->frame_related = 0; RTX_FLAG (copy, frame_related) = 0;
copy->jump = orig->jump; RTX_FLAG (copy, jump) = RTX_FLAG (orig, jump);
copy->call = orig->call; RTX_FLAG (copy, call) = RTX_FLAG (orig, call);
format_ptr = GET_RTX_FORMAT (GET_CODE (copy)); format_ptr = GET_RTX_FORMAT (GET_CODE (copy));
...@@ -390,11 +390,11 @@ shallow_copy_rtx (orig) ...@@ -390,11 +390,11 @@ shallow_copy_rtx (orig)
rtx copy = rtx_alloc (code); rtx copy = rtx_alloc (code);
PUT_MODE (copy, GET_MODE (orig)); PUT_MODE (copy, GET_MODE (orig));
copy->in_struct = orig->in_struct; RTX_FLAG (copy, in_struct) = RTX_FLAG (orig, in_struct);
copy->volatil = orig->volatil; RTX_FLAG (copy, volatil) = RTX_FLAG (orig, volatil);
copy->unchanging = orig->unchanging; RTX_FLAG (copy, unchanging) = RTX_FLAG (orig, unchanging);
copy->integrated = orig->integrated; RTX_FLAG (copy, integrated) = RTX_FLAG (orig, integrated);
copy->frame_related = orig->frame_related; RTX_FLAG (copy, frame_related) = RTX_FLAG (orig, frame_related);
for (i = 0; i < GET_RTX_LENGTH (code); i++) for (i = 0; i < GET_RTX_LENGTH (code); i++)
copy->fld[i] = orig->fld[i]; copy->fld[i] = orig->fld[i];
...@@ -637,3 +637,17 @@ rtvec_check_failed_bounds (r, n, file, line, func) ...@@ -637,3 +637,17 @@ rtvec_check_failed_bounds (r, n, file, line, func)
n, GET_NUM_ELEM (r) - 1, func, trim_filename (file), line); n, GET_NUM_ELEM (r) - 1, func, trim_filename (file), line);
} }
#endif /* ENABLE_RTL_CHECKING */ #endif /* ENABLE_RTL_CHECKING */
#if defined ENABLE_RTL_FLAG_CHECKING
void
rtl_check_failed_flag (r, file, line, func)
rtx r;
const char *file;
int line;
const char *func;
{
internal_error
("RTL flag check: access macro used with unexpected rtx code `%s' in %s, at %s:%d",
GET_RTX_NAME (GET_CODE (r)), func, trim_filename (file), line);
}
#endif /* ENABLE_RTL_FLAG_CHECKING */
...@@ -127,31 +127,30 @@ struct rtx_def ...@@ -127,31 +127,30 @@ struct rtx_def
/* The kind of value the expression has. */ /* The kind of value the expression has. */
ENUM_BITFIELD(machine_mode) mode : 8; ENUM_BITFIELD(machine_mode) mode : 8;
/* 1 in an INSN if it can alter flow of control /* 1 in a MEM if we should keep the alias set for this mem unchanged
within this function. when we access a component.
MEM_KEEP_ALIAS_SET_P in a MEM. 1 in a CALL_INSN if it is a sibling call.
SET_IS_RETURN_P in a SET. */ 1 in a SET that is for a return. */
unsigned int jump : 1; unsigned int jump : 1;
/* 1 in an INSN if it can call another function. */ /* This flag is currently unused. */
unsigned int call : 1; unsigned int call : 1;
/* 1 in a REG if value of this expression will never change during /* 1 in a REG, MEM, or CONCAT if the value is set at most once, anywhere.
the current function, even though it is not manifestly constant. 1 in a SUBREG if it references an unsigned object whose mode has been
1 in a MEM if contents of memory are constant. This does not from a promoted to a wider mode.
necessarily mean that the value of this expression is constant.
1 in a SUBREG if it is from a promoted variable that is unsigned.
1 in a SYMBOL_REF if it addresses something in the per-function 1 in a SYMBOL_REF if it addresses something in the per-function
constants pool. constants pool.
1 in a CALL_INSN if it is a const call. 1 in a CALL_INSN, NOTE, or EXPR_LIST for a const or pure call.
1 in a JUMP_INSN if it is a branch that should be annulled. Valid from 1 in an INSN in the delay slot of a branch insn if an annulling branch
reorg until end of compilation; cleared before used. */ should be used. */
unsigned int unchanging : 1; unsigned int unchanging : 1;
/* 1 in a MEM expression if contents of memory are volatile. /* 1 in a MEM or ASM_OPERANDS expression if the memory reference is volatile.
1 in an INSN, CALL_INSN, JUMP_INSN, CODE_LABEL or BARRIER 1 in an INSN, CALL_INSN, JUMP_INSN, CODE_LABEL, BARRIER, or NOTE
if it is deleted. if it has been deleted.
1 in a REG expression if corresponds to a variable declared by the user. 1 in a REG expression if corresponds to a variable declared by the user,
0 for an internally generated temporary. 0 for an internally generated temporary.
In a SYMBOL_REF, this flag is used for machine-specific purposes. 1 in a SUBREG with a negative value.
In a LABEL_REF or in a REG_LABEL note, this is LABEL_REF_NONLOCAL_P. */ 1 in a LABEL_REF or in a REG_LABEL note for a non-local label.
In a SYMBOL_REF, this flag is used for machine-specific purposes. */
unsigned int volatil : 1; unsigned int volatil : 1;
/* 1 in a MEM referring to a field of an aggregate. /* 1 in a MEM referring to a field of an aggregate.
0 if the MEM was a variable or the result of a * operator in C; 0 if the MEM was a variable or the result of a * operator in C;
...@@ -163,23 +162,25 @@ struct rtx_def ...@@ -163,23 +162,25 @@ struct rtx_def
and must not be deleted even if its count is zero. and must not be deleted even if its count is zero.
1 in a LABEL_REF if this is a reference to a label outside the 1 in a LABEL_REF if this is a reference to a label outside the
current loop. current loop.
1 in an INSN, JUMP_INSN, or CALL_INSN if this insn must be scheduled 1 in an INSN, JUMP_INSN, CALL_INSN, CODE_LABEL, BARRIER, or NOTE if
together with the preceding insn. Valid only within sched. this insn must be scheduled together with the preceding insn. Valid
only within sched.
1 in an INSN, JUMP_INSN, or CALL_INSN if insn is in a delay slot and 1 in an INSN, JUMP_INSN, or CALL_INSN if insn is in a delay slot and
from the target of a branch. Valid from reorg until end of compilation; from the target of a branch. Valid from reorg until end of compilation;
cleared before used. cleared before used.
1 in an INSN if this insn is dead code. Valid only during 1 in an INSN in a delay slot that is the target of a branch, during reorg.
1 in an INSN or related rtx if this insn is dead code. Valid only during
dead-code elimination phase; cleared before use. */ dead-code elimination phase; cleared before use. */
unsigned int in_struct : 1; unsigned int in_struct : 1;
/* 1 if this rtx is used. This is used for copying shared structure. /* At the end of RTL generation, 1 if this rtx is used. This is used for
See `unshare_all_rtl'. copying shared structure. See `unshare_all_rtl'.
In a REG, this is not needed for that purpose, and used instead In a REG, this is not needed for that purpose, and used instead
in `leaf_renumber_regs_insn'. in `leaf_renumber_regs_insn'.
In a SYMBOL_REF, means that emit_library_call 1 in a SYMBOL_REF, means that emit_library_call
has used it as the function. */ has used it as the function. */
unsigned int used : 1; unsigned int used : 1;
/* Nonzero if this rtx came from procedure integration. /* Nonzero if this rtx came from procedure integration.
In a REG, nonzero means this reg refers to the return value 1 in a REG means this reg refers to the return value
of the current function. of the current function.
1 in a SYMBOL_REF if the symbol is weak. */ 1 in a SYMBOL_REF if the symbol is weak. */
unsigned integrated : 1; unsigned integrated : 1;
...@@ -209,11 +210,6 @@ struct rtx_def ...@@ -209,11 +210,6 @@ struct rtx_def
#define GET_MODE(RTX) ((enum machine_mode) (RTX)->mode) #define GET_MODE(RTX) ((enum machine_mode) (RTX)->mode)
#define PUT_MODE(RTX, MODE) ((RTX)->mode = (ENUM_BITFIELD(machine_mode)) (MODE)) #define PUT_MODE(RTX, MODE) ((RTX)->mode = (ENUM_BITFIELD(machine_mode)) (MODE))
#define RTX_FLAG(RTX,FLAG) ((RTX)->FLAG)
#define RTX_INTEGRATED_P(RTX) ((RTX)->integrated)
#define RTX_UNCHANGING_P(RTX) ((RTX)->unchanging)
#define RTX_FRAME_RELATED_P(RTX) ((RTX)->frame_related)
/* RTL vector. These appear inside RTX's when there is a need /* RTL vector. These appear inside RTX's when there is a need
for a variable number of things. The principle use is inside for a variable number of things. The principle use is inside
PARALLEL expressions. */ PARALLEL expressions. */
...@@ -336,6 +332,102 @@ extern void rtvec_check_failed_bounds PARAMS ((rtvec, int, ...@@ -336,6 +332,102 @@ extern void rtvec_check_failed_bounds PARAMS ((rtvec, int,
#endif #endif
/* General accessor macros for accessing the flags of an rtx. */
/* Access an individual rtx flag, with no checking of any kind. */
#define RTX_FLAG(RTX, FLAG) ((RTX)->FLAG)
#if defined ENABLE_RTL_FLAG_CHECKING
#define RTL_FLAG_CHECK1(RTX, C1) __extension__ \
({ rtx const _rtx = (RTX); \
if (GET_CODE(_rtx) != C1) \
rtl_check_failed_flag (_rtx, __FILE__, __LINE__, __FUNCTION__); \
_rtx; })
#define RTL_FLAG_CHECK2(RTX, C1, C2) __extension__ \
({ rtx const _rtx = (RTX); \
if (GET_CODE(_rtx) != C1 && GET_CODE(_rtx) != C2) \
rtl_check_failed_flag (_rtx, __FILE__, __LINE__, __FUNCTION__); \
_rtx; })
#define RTL_FLAG_CHECK3(RTX, C1, C2, C3) __extension__ \
({ rtx const _rtx = (RTX); \
if (GET_CODE(_rtx) != C1 && GET_CODE(_rtx) != C2 \
&& GET_CODE(_rtx) != C3) \
rtl_check_failed_flag (_rtx, __FILE__, __LINE__, __FUNCTION__); \
_rtx; })
#define RTL_FLAG_CHECK4(RTX, C1, C2, C3, C4) __extension__ \
({ rtx const _rtx = (RTX); \
if (GET_CODE(_rtx) != C1 && GET_CODE(_rtx) != C2 \
&& GET_CODE(_rtx) != C3 && GET_CODE(_rtx) != C4) \
rtl_check_failed_flag (_rtx, __FILE__, __LINE__, __FUNCTION__); \
_rtx; })
#define RTL_FLAG_CHECK5(RTX, C1, C2, C3, C4, C5) __extension__ \
({ rtx const _rtx = (RTX); \
if (GET_CODE(_rtx) != C1 && GET_CODE(_rtx) != C2 \
&& GET_CODE(_rtx) != C3 && GET_CODE(_rtx) != C4 \
&& GET_CODE(_rtx) != C5) \
rtl_check_failed_flag (_rtx, __FILE__, __LINE__, __FUNCTION__); \
_rtx; })
#define RTL_FLAG_CHECK6(RTX, C1, C2, C3, C4, C5, C6) __extension__ \
({ rtx const _rtx = (RTX); \
if (GET_CODE(_rtx) != C1 && GET_CODE(_rtx) != C2 \
&& GET_CODE(_rtx) != C3 && GET_CODE(_rtx) != C4 \
&& GET_CODE(_rtx) != C5 && GET_CODE(_rtx) != C6) \
rtl_check_failed_flag (_rtx, __FILE__, __LINE__, __FUNCTION__); \
_rtx; })
#define RTL_FLAG_CHECK7(RTX, C1, C2, C3, C4, C5, C6, C7) __extension__ \
({ rtx const _rtx = (RTX); \
if (GET_CODE(_rtx) != C1 && GET_CODE(_rtx) != C2 \
&& GET_CODE(_rtx) != C3 && GET_CODE(_rtx) != C4 \
&& GET_CODE(_rtx) != C5 && GET_CODE(_rtx) != C6 \
&& GET_CODE(_rtx) != C7) \
rtl_check_failed_flag (_rtx, __FILE__, __LINE__, __FUNCTION__); \
_rtx; })
#define RTL_FLAG_CHECK8(RTX, C1, C2, C3, C4, C5, C6, C7, C8) __extension__ \
({ rtx const _rtx = (RTX); \
if (GET_CODE(_rtx) != C1 && GET_CODE(_rtx) != C2 \
&& GET_CODE(_rtx) != C3 && GET_CODE(_rtx) != C4 \
&& GET_CODE(_rtx) != C5 && GET_CODE(_rtx) != C6 \
&& GET_CODE(_rtx) != C7 && GET_CODE(_rtx) != C8) \
rtl_check_failed_flag (_rtx, __FILE__, __LINE__, __FUNCTION__); \
_rtx; })
extern void rtl_check_failed_flag PARAMS ((rtx, const char *, int,
const char *))
ATTRIBUTE_NORETURN
;
#else /* not ENABLE_RTL_FLAG_CHECKING */
#define RTL_FLAG_CHECK1(RTX, C1) (RTX)
#define RTL_FLAG_CHECK2(RTX, C1, C2) (RTX)
#define RTL_FLAG_CHECK3(RTX, C1, C2, C3) (RTX)
#define RTL_FLAG_CHECK4(RTX, C1, C2, C3, C4) (RTX)
#define RTL_FLAG_CHECK5(RTX, C1, C2, C3, C4, C5) (RTX)
#define RTL_FLAG_CHECK6(RTX, C1, C2, C3, C4, C5, C6) (RTX)
#define RTL_FLAG_CHECK7(RTX, C1, C2, C3, C4, C5, C6, C7) (RTX)
#define RTL_FLAG_CHECK8(RTX, C1, C2, C3, C4, C5, C6, C7, C8) (RTX)
#endif
#define CLEAR_RTX_FLAGS(RTX) \
do { \
rtx const _rtx = (RTX); \
_rtx->call = 0; \
_rtx->frame_related = 0; \
_rtx->in_struct = 0; \
_rtx->integrated = 0; \
_rtx->jump = 0; \
_rtx->unchanging = 0; \
_rtx->used = 0; \
_rtx->volatil = 0; \
} while (0)
#define XWINT(RTX, N) (RTL_CHECK1 (RTX, N, 'w').rtwint) #define XWINT(RTX, N) (RTL_CHECK1 (RTX, N, 'w').rtwint)
#define XINT(RTX, N) (RTL_CHECK2 (RTX, N, 'i', 'n').rtint) #define XINT(RTX, N) (RTL_CHECK2 (RTX, N, 'i', 'n').rtint)
#define XSTR(RTX, N) (RTL_CHECK2 (RTX, N, 's', 'S').rtstr) #define XSTR(RTX, N) (RTL_CHECK2 (RTX, N, 's', 'S').rtstr)
...@@ -412,27 +504,39 @@ extern void rtvec_check_failed_bounds PARAMS ((rtvec, int, ...@@ -412,27 +504,39 @@ extern void rtvec_check_failed_bounds PARAMS ((rtvec, int,
They are always in the same basic block as this insn. */ They are always in the same basic block as this insn. */
#define LOG_LINKS(INSN) XEXP(INSN, 5) #define LOG_LINKS(INSN) XEXP(INSN, 5)
#define RTX_INTEGRATED_P(RTX) \
(RTL_FLAG_CHECK8((RTX), INSN, CALL_INSN, JUMP_INSN, INSN_LIST, \
BARRIER, CODE_LABEL, CONST, NOTE)->integrated)
#define RTX_UNCHANGING_P(RTX) \
(RTL_FLAG_CHECK3((RTX), REG, MEM, CONCAT)->unchanging)
#define RTX_FRAME_RELATED_P(RTX) \
(RTL_FLAG_CHECK5((RTX), INSN, CALL_INSN, JUMP_INSN, BARRIER, \
SET)->frame_related)
/* 1 if insn has been deleted. */ /* 1 if insn has been deleted. */
#define INSN_DELETED_P(INSN) ((INSN)->volatil) #define INSN_DELETED_P(RTX) \
(RTL_FLAG_CHECK6((RTX), INSN, CALL_INSN, JUMP_INSN, CODE_LABEL, \
BARRIER, NOTE)->volatil)
/* 1 if insn is a call to a const or pure function. */ /* 1 if insn is a call to a const or pure function. */
#define CONST_OR_PURE_CALL_P(INSN) ((INSN)->unchanging) #define CONST_OR_PURE_CALL_P(RTX) \
(RTL_FLAG_CHECK3((RTX), CALL_INSN, NOTE, EXPR_LIST)->unchanging)
/* 1 if insn (assumed to be a CALL_INSN) is a sibling call. */ /* 1 if insn (assumed to be a CALL_INSN) is a sibling call. */
#define SIBLING_CALL_P(INSN) ((INSN)->jump) #define SIBLING_CALL_P(INSN) (RTL_FLAG_CHECK1((INSN), CALL_INSN)->jump)
/* 1 if insn is a branch that should not unconditionally execute its /* 1 in an INSN in the delay slot of a branch insn if an annulling branch
delay slots, i.e., it is an annulled branch. */ should be used. */
#define INSN_ANNULLED_BRANCH_P(INSN) ((INSN)->unchanging) #define INSN_ANNULLED_BRANCH_P(RTX) (RTL_FLAG_CHECK1((RTX), INSN)->unchanging)
/* 1 if insn is a dead code. Valid only for dead-code elimination phase. */ /* 1 if insn is a dead code. Valid only for dead-code elimination phase. */
#define INSN_DEAD_CODE_P(INSN) ((INSN)->in_struct) #define INSN_DEAD_CODE_P(RTX) (RTL_FLAG_CHECK1((RTX), INSN)->in_struct)
/* 1 if insn is in a delay slot and is from the target of the branch. If /* 1 if insn is in a delay slot and is from the target of the branch. If
the branch insn has INSN_ANNULLED_BRANCH_P set, this insn should only be the branch insn has INSN_ANNULLED_BRANCH_P set, this insn should only be
executed if the branch is taken. For annulled branches with this bit executed if the branch is taken. For annulled branches with this bit
clear, the insn should be executed only if the branch is not taken. */ clear, the insn should be executed only if the branch is not taken. */
#define INSN_FROM_TARGET_P(INSN) ((INSN)->in_struct) #define INSN_FROM_TARGET_P(RTX) (RTL_FLAG_CHECK1((RTX), INSN)->in_struct)
#define ADDR_DIFF_VEC_FLAGS(RTX) X0ADVFLAGS(RTX, 4) #define ADDR_DIFF_VEC_FLAGS(RTX) X0ADVFLAGS(RTX, 4)
...@@ -792,13 +896,13 @@ extern const char * const note_insn_name[NOTE_INSN_MAX - NOTE_INSN_BIAS]; ...@@ -792,13 +896,13 @@ extern const char * const note_insn_name[NOTE_INSN_MAX - NOTE_INSN_BIAS];
/* For a REG rtx, REG_FUNCTION_VALUE_P is nonzero if the reg /* For a REG rtx, REG_FUNCTION_VALUE_P is nonzero if the reg
is the current function's return value. */ is the current function's return value. */
#define REG_FUNCTION_VALUE_P(RTX) ((RTX)->integrated) #define REG_FUNCTION_VALUE_P(RTX) (RTL_FLAG_CHECK1((RTX), REG)->integrated)
/* 1 in a REG rtx if it corresponds to a variable declared by the user. */ /* 1 in a REG rtx if it corresponds to a variable declared by the user. */
#define REG_USERVAR_P(RTX) ((RTX)->volatil) #define REG_USERVAR_P(RTX) (RTL_FLAG_CHECK1((RTX), REG)->volatil)
/* 1 in a REG rtx if the register is a pointer. */ /* 1 in a REG rtx if the register is a pointer. */
#define REG_POINTER(RTX) ((RTX)->frame_related) #define REG_POINTER(RTX) (RTL_FLAG_CHECK1((RTX), REG)->frame_related)
/* 1 if the given register REG corresponds to a hard register. */ /* 1 if the given register REG corresponds to a hard register. */
#define HARD_REGISTER_P(REG) (HARD_REGISTER_NUM_P (REGNO (REG))) #define HARD_REGISTER_P(REG) (HARD_REGISTER_NUM_P (REGNO (REG)))
...@@ -851,9 +955,10 @@ extern unsigned int subreg_regno PARAMS ((rtx)); ...@@ -851,9 +955,10 @@ extern unsigned int subreg_regno PARAMS ((rtx));
When used as a LHS, is means that this extension must be done When used as a LHS, is means that this extension must be done
when assigning to SUBREG_REG. */ when assigning to SUBREG_REG. */
#define SUBREG_PROMOTED_VAR_P(RTX) ((RTX)->in_struct) #define SUBREG_PROMOTED_VAR_P(RTX) (RTL_FLAG_CHECK1((RTX), SUBREG)->in_struct)
#define SUBREG_PROMOTED_UNSIGNED_SET(RTX, VAL) \ #define SUBREG_PROMOTED_UNSIGNED_SET(RTX, VAL) \
do { \ do { \
RTL_FLAG_CHECK1((RTX), SUBREG); \
if ((VAL) < 0) \ if ((VAL) < 0) \
(RTX)->volatil = 1; \ (RTX)->volatil = 1; \
else { \ else { \
...@@ -861,7 +966,8 @@ do { \ ...@@ -861,7 +966,8 @@ do { \
(RTX)->unchanging = (VAL); \ (RTX)->unchanging = (VAL); \
} \ } \
} while (0) } while (0)
#define SUBREG_PROMOTED_UNSIGNED_P(RTX) ((RTX)->volatil ? -1 : (RTX)->unchanging) #define SUBREG_PROMOTED_UNSIGNED_P(RTX) \
((RTL_FLAG_CHECK1((RTX), SUBREG)->volatil) ? -1 : (RTX)->unchanging)
/* Access various components of an ASM_OPERANDS rtx. */ /* Access various components of an ASM_OPERANDS rtx. */
...@@ -884,20 +990,20 @@ do { \ ...@@ -884,20 +990,20 @@ do { \
/* For a MEM RTX, 1 if we should keep the alias set for this mem /* For a MEM RTX, 1 if we should keep the alias set for this mem
unchanged when we access a component. Set to 1, or example, when we unchanged when we access a component. Set to 1, or example, when we
are already in a non-addressable component of an aggregate. */ are already in a non-addressable component of an aggregate. */
#define MEM_KEEP_ALIAS_SET_P(RTX) ((RTX)->jump) #define MEM_KEEP_ALIAS_SET_P(RTX) (RTL_FLAG_CHECK1((RTX), MEM)->jump)
/* For a MEM rtx, 1 if it's a volatile reference. /* For a MEM rtx, 1 if it's a volatile reference.
Also in an ASM_OPERANDS rtx. */ Also in an ASM_OPERANDS rtx. */
#define MEM_VOLATILE_P(RTX) ((RTX)->volatil) #define MEM_VOLATILE_P(RTX) (RTL_FLAG_CHECK2((RTX), MEM, ASM_OPERANDS)->volatil)
/* For a MEM rtx, 1 if it refers to an aggregate, either to the /* For a MEM rtx, 1 if it refers to an aggregate, either to the
aggregate itself of to a field of the aggregate. If zero, RTX may aggregate itself of to a field of the aggregate. If zero, RTX may
or may not be such a reference. */ or may not be such a reference. */
#define MEM_IN_STRUCT_P(RTX) ((RTX)->in_struct) #define MEM_IN_STRUCT_P(RTX) (RTL_FLAG_CHECK1((RTX), MEM)->in_struct)
/* For a MEM rtx, 1 if it refers to a scalar. If zero, RTX may or may /* For a MEM rtx, 1 if it refers to a scalar. If zero, RTX may or may
not refer to a scalar. */ not refer to a scalar. */
#define MEM_SCALAR_P(RTX) ((RTX)->frame_related) #define MEM_SCALAR_P(RTX) (RTL_FLAG_CHECK1((RTX), MEM)->frame_related)
/* If VAL is non-zero, set MEM_IN_STRUCT_P and clear MEM_SCALAR_P in /* If VAL is non-zero, set MEM_IN_STRUCT_P and clear MEM_SCALAR_P in
RTX. Otherwise, vice versa. Use this macro only when you are RTX. Otherwise, vice versa. Use this macro only when you are
...@@ -965,27 +1071,31 @@ do { \ ...@@ -965,27 +1071,31 @@ do { \
/* For a LABEL_REF, 1 means that this reference is to a label outside the /* For a LABEL_REF, 1 means that this reference is to a label outside the
loop containing the reference. */ loop containing the reference. */
#define LABEL_OUTSIDE_LOOP_P(RTX) ((RTX)->in_struct) #define LABEL_OUTSIDE_LOOP_P(RTX) (RTL_FLAG_CHECK1((RTX), LABEL_REF)->in_struct)
/* For a LABEL_REF, 1 means it is for a nonlocal label. */ /* For a LABEL_REF, 1 means it is for a nonlocal label. */
/* Likewise in an EXPR_LIST for a REG_LABEL note. */ /* Likewise in an EXPR_LIST for a REG_LABEL note. */
#define LABEL_REF_NONLOCAL_P(RTX) ((RTX)->volatil) #define LABEL_REF_NONLOCAL_P(RTX) \
(RTL_FLAG_CHECK2((RTX), LABEL_REF, REG_LABEL)->volatil)
/* For a CODE_LABEL, 1 means always consider this label to be needed. */ /* For a CODE_LABEL, 1 means always consider this label to be needed. */
#define LABEL_PRESERVE_P(RTX) ((RTX)->in_struct) #define LABEL_PRESERVE_P(RTX) \
(RTL_FLAG_CHECK2((RTX), CODE_LABEL, NOTE)->in_struct)
/* For a REG, 1 means the register is used only in an exit test of a loop. */ /* For a REG, 1 means the register is used only in an exit test of a loop. */
#define REG_LOOP_TEST_P(RTX) ((RTX)->in_struct) #define REG_LOOP_TEST_P(RTX) (RTL_FLAG_CHECK1((RTX), REG)->in_struct)
/* During sched, for an insn, 1 means that the insn must be scheduled together /* During sched, for an insn, 1 means that the insn must be scheduled together
with the preceding insn. */ with the preceding insn. */
#define SCHED_GROUP_P(INSN) ((INSN)->in_struct) #define SCHED_GROUP_P(RTX) \
(RTL_FLAG_CHECK6((RTX), INSN, JUMP_INSN, CALL_INSN, CODE_LABEL, \
BARRIER, NOTE)->in_struct)
/* For a SET rtx, SET_DEST is the place that is set /* For a SET rtx, SET_DEST is the place that is set
and SET_SRC is the value it is set to. */ and SET_SRC is the value it is set to. */
#define SET_DEST(RTX) XC2EXP(RTX, 0, SET, CLOBBER) #define SET_DEST(RTX) XC2EXP(RTX, 0, SET, CLOBBER)
#define SET_SRC(RTX) XCEXP(RTX, 1, SET) #define SET_SRC(RTX) XCEXP(RTX, 1, SET)
#define SET_IS_RETURN_P(RTX) ((RTX)->jump) #define SET_IS_RETURN_P(RTX) (RTL_FLAG_CHECK1((RTX), SET)->jump)
/* For a TRAP_IF rtx, TRAP_CONDITION is an expression. */ /* For a TRAP_IF rtx, TRAP_CONDITION is an expression. */
#define TRAP_CONDITION(RTX) XCEXP (RTX, 0, TRAP_IF) #define TRAP_CONDITION(RTX) XCEXP (RTX, 0, TRAP_IF)
...@@ -998,19 +1108,21 @@ do { \ ...@@ -998,19 +1108,21 @@ do { \
#define COND_EXEC_CODE(RTX) XCEXP (RTX, 1, COND_EXEC) #define COND_EXEC_CODE(RTX) XCEXP (RTX, 1, COND_EXEC)
/* 1 in a SYMBOL_REF if it addresses this function's constants pool. */ /* 1 in a SYMBOL_REF if it addresses this function's constants pool. */
#define CONSTANT_POOL_ADDRESS_P(RTX) ((RTX)->unchanging) #define CONSTANT_POOL_ADDRESS_P(RTX) \
(RTL_FLAG_CHECK1((RTX), SYMBOL_REF)->unchanging)
/* 1 in a SYMBOL_REF if it addresses this function's string constant pool. */ /* 1 in a SYMBOL_REF if it addresses this function's string constant pool. */
#define STRING_POOL_ADDRESS_P(RTX) ((RTX)->frame_related) #define STRING_POOL_ADDRESS_P(RTX) \
(RTL_FLAG_CHECK1((RTX), SYMBOL_REF)->frame_related)
/* Flag in a SYMBOL_REF for machine-specific purposes. */ /* Flag in a SYMBOL_REF for machine-specific purposes. */
#define SYMBOL_REF_FLAG(RTX) ((RTX)->volatil) #define SYMBOL_REF_FLAG(RTX) (RTL_FLAG_CHECK1((RTX), SYMBOL_REF)->volatil)
/* 1 means a SYMBOL_REF has been the library function in emit_library_call. */ /* 1 means a SYMBOL_REF has been the library function in emit_library_call. */
#define SYMBOL_REF_USED(RTX) ((RTX)->used) #define SYMBOL_REF_USED(RTX) (RTL_FLAG_CHECK1((RTX), SYMBOL_REF)->used)
/* 1 means a SYMBOL_REF is weak. */ /* 1 means a SYMBOL_REF is weak. */
#define SYMBOL_REF_WEAK(RTX) ((RTX)->integrated) #define SYMBOL_REF_WEAK(RTX) (RTL_FLAG_CHECK1((RTX), SYMBOL_REF)->integrated)
/* Define a macro to look for REG_INC notes, /* Define a macro to look for REG_INC notes,
but save time on machines where they never exist. */ but save time on machines where they never exist. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment