Commit 2d4cc6a7 by Janis Johnson Committed by Janis Johnson

rtl.h (RTL_FLAG_CHECK*): Add an argument for the macro name, and use it in all…

rtl.h (RTL_FLAG_CHECK*): Add an argument for the macro name, and use it in all invocations of these macros.

	* rtl.h (RTL_FLAG_CHECK*): Add an argument for the macro name,
	and use it in all invocations of these macros.  Clean up comments.
	* rtl.c (rtl_check_failed_flag): Add an argument for the name
	of the flag access macro whose check failed.
	* doc/rtl.texi (Flags): Document additional flag uses.

From-SVN: r53306
parent ea45dbb8
2002-05-08 Janis Johnson <janis187@us.ibm.com>
* rtl.h (RTL_FLAG_CHECK*): Add an argument for the macro name,
and use it in all invocations of these macros. Clean up comments.
* rtl.c (rtl_check_failed_flag): Add an argument for the name
of the flag access macro whose check failed.
* doc/rtl.texi (Flags): Document additional flag uses.
2002-05-08 Robert Spier <rspier@pobox.com> 2002-05-08 Robert Spier <rspier@pobox.com>
Neil Booth <neil@daikokuya.demon.co.uk> Neil Booth <neil@daikokuya.demon.co.uk>
......
...@@ -396,9 +396,11 @@ Stored in the @code{unchanging} field and printed as @samp{/u}. ...@@ -396,9 +396,11 @@ Stored in the @code{unchanging} field and printed as @samp{/u}.
@findex INSN_ANNULLED_BRANCH_P @findex INSN_ANNULLED_BRANCH_P
@cindex @code{insn} and @samp{/u} @cindex @code{insn} and @samp{/u}
@cindex @code{unchanging}, in @code{insn} @cindex @code{jump_insn} and @samp{/u}
@cindex @code{unchanging}, in @code{insn} and @code{jump_insn}
@item INSN_ANNULLED_BRANCH_P (@var{x}) @item INSN_ANNULLED_BRANCH_P (@var{x})
In an @code{insn} in the delay slot of a branch insn, indicates that an In an @code{insn} or @code{jump_insn} in the delay slot of a branch insn,
indicates that an
annulling branch should be used. See the discussion under annulling branch should be used. See the discussion under
@code{sequence} below. Stored in the @code{unchanging} field and printed @code{sequence} below. Stored in the @code{unchanging} field and printed
as @samp{/u}. as @samp{/u}.
...@@ -427,9 +429,11 @@ nonzero if the insn has been deleted. Stored in the ...@@ -427,9 +429,11 @@ nonzero if the insn has been deleted. Stored in the
@findex INSN_FROM_TARGET_P @findex INSN_FROM_TARGET_P
@cindex @code{insn} and @samp{/s} @cindex @code{insn} and @samp{/s}
@cindex @code{in_struct}, in @code{insn} @cindex @code{jump_insn} and @samp{/s}
@cindex @code{in_struct}, in @code{insn} and @code{jump_insn}
@item INSN_FROM_TARGET_P (@var{x}) @item INSN_FROM_TARGET_P (@var{x})
In an @code{insn} in a delay slot of a branch, indicates that the insn In an @code{insn} or @code{jump_insn} in a delay slot of a branch,
indicates that the insn
is from the target of the branch. If the branch insn has is from the target of the branch. If the branch insn has
@code{INSN_ANNULLED_BRANCH_P} set, this insn will only be executed if @code{INSN_ANNULLED_BRANCH_P} set, this insn will only be executed if
the branch is taken. For annulled branches with the branch is taken. For annulled branches with
...@@ -499,11 +503,12 @@ Stored in the @code{frame_related} field and printed as @samp{/f}. ...@@ -499,11 +503,12 @@ Stored in the @code{frame_related} field and printed as @samp{/f}.
@findex MEM_VOLATILE_P @findex MEM_VOLATILE_P
@cindex @code{mem} and @samp{/v} @cindex @code{mem} and @samp{/v}
@cindex @code{asm_input} and @samp{/v}
@cindex @code{asm_operands} and @samp{/v} @cindex @code{asm_operands} and @samp{/v}
@cindex @code{volatil}, in @code{mem} and @code{asm_operands} @cindex @code{volatil}, in @code{mem}, @code{asm_operands}, and @code{asm_input}
@item MEM_VOLATILE_P (@var{x}) @item MEM_VOLATILE_P (@var{x})
In @code{mem} and @code{asm_operands} expressions, nonzero for volatile In @code{mem}, @code{asm_operands}, and @code{asm_input} expressions,
memory references. nonzero for volatile memory references.
Stored in the @code{volatil} field and printed as @samp{/v}. Stored in the @code{volatil} field and printed as @samp{/v}.
@findex REG_FUNCTION_VALUE_P @findex REG_FUNCTION_VALUE_P
...@@ -758,7 +763,8 @@ label that would have been deleted is replaced with a @code{note} of type ...@@ -758,7 +763,8 @@ label that would have been deleted is replaced with a @code{note} of type
In an @code{insn} during dead-code elimination, 1 means that the insn is In an @code{insn} during dead-code elimination, 1 means that the insn is
dead code. dead code.
In an @code{insn} during reorg for an insn in the delay slot of a branch, In an @code{insn} or @code{jump_insn} during reorg for an insn in the
delay slot of a branch,
1 means that this insn is from the target of the branch. 1 means that this insn is from the target of the branch.
In an @code{insn} during instruction scheduling, 1 means that this insn In an @code{insn} during instruction scheduling, 1 means that this insn
...@@ -803,8 +809,8 @@ that the value of the expression never changes. ...@@ -803,8 +809,8 @@ that the value of the expression never changes.
In @code{subreg} expressions, it is 1 if the @code{subreg} references an In @code{subreg} expressions, it is 1 if the @code{subreg} references an
unsigned object whose mode has been promoted to a wider mode. unsigned object whose mode has been promoted to a wider mode.
In an @code{insn} in the delay slot of a branch instruction, 1 means In an @code{insn} or @code{jump_insn} in the delay slot of a branch
an annulling branch should be used. instruction, 1 means an annulling branch should be used.
In a @code{symbol_ref} expression, 1 means that this symbol addresses In a @code{symbol_ref} expression, 1 means that this symbol addresses
something in the per-function constant pool. something in the per-function constant pool.
...@@ -832,7 +838,8 @@ the symbol has already been written. ...@@ -832,7 +838,8 @@ the symbol has already been written.
@cindex @samp{/v} in RTL dump @cindex @samp{/v} in RTL dump
@item volatil @item volatil
@cindex volatile memory references @cindex volatile memory references
In a @code{mem} or @code{asm_operands} expression, it is 1 if the memory In a @code{mem}, @code{asm_operands}, or @code{asm_input}
expression, it is 1 if the memory
reference is volatile. Volatile memory references may not be deleted, reference is volatile. Volatile memory references may not be deleted,
reordered or combined. reordered or combined.
......
...@@ -641,14 +641,15 @@ rtvec_check_failed_bounds (r, n, file, line, func) ...@@ -641,14 +641,15 @@ rtvec_check_failed_bounds (r, n, file, line, func)
#if defined ENABLE_RTL_FLAG_CHECKING #if defined ENABLE_RTL_FLAG_CHECKING
void void
rtl_check_failed_flag (r, file, line, func) rtl_check_failed_flag (name, r, file, line, func)
const char *name;
rtx r; rtx r;
const char *file; const char *file;
int line; int line;
const char *func; const char *func;
{ {
internal_error internal_error
("RTL flag check: access macro used with unexpected rtx code `%s' in %s, at %s:%d", ("RTL flag check: %s used with unexpected rtx code `%s' in %s, at %s:%d",
GET_RTX_NAME (GET_CODE (r)), func, trim_filename (file), line); name, GET_RTX_NAME (GET_CODE (r)), func, trim_filename (file), line);
} }
#endif /* ENABLE_RTL_FLAG_CHECKING */ #endif /* ENABLE_RTL_FLAG_CHECKING */
...@@ -338,81 +338,92 @@ extern void rtvec_check_failed_bounds PARAMS ((rtvec, int, ...@@ -338,81 +338,92 @@ extern void rtvec_check_failed_bounds PARAMS ((rtvec, int,
#define RTX_FLAG(RTX, FLAG) ((RTX)->FLAG) #define RTX_FLAG(RTX, FLAG) ((RTX)->FLAG)
#if defined ENABLE_RTL_FLAG_CHECKING #if defined ENABLE_RTL_FLAG_CHECKING
#define RTL_FLAG_CHECK1(RTX, C1) __extension__ \ #define RTL_FLAG_CHECK1(NAME, RTX, C1) __extension__ \
({ rtx const _rtx = (RTX); \ ({ rtx const _rtx = (RTX); \
if (GET_CODE(_rtx) != C1) \ if (GET_CODE(_rtx) != C1) \
rtl_check_failed_flag (_rtx, __FILE__, __LINE__, __FUNCTION__); \ rtl_check_failed_flag (NAME, _rtx, __FILE__, __LINE__, \
__FUNCTION__); \
_rtx; }) _rtx; })
#define RTL_FLAG_CHECK2(RTX, C1, C2) __extension__ \ #define RTL_FLAG_CHECK2(NAME, RTX, C1, C2) __extension__ \
({ rtx const _rtx = (RTX); \ ({ rtx const _rtx = (RTX); \
if (GET_CODE(_rtx) != C1 && GET_CODE(_rtx) != C2) \ if (GET_CODE(_rtx) != C1 && GET_CODE(_rtx) != C2) \
rtl_check_failed_flag (_rtx, __FILE__, __LINE__, __FUNCTION__); \ rtl_check_failed_flag (NAME,_rtx, __FILE__, __LINE__, \
__FUNCTION__); \
_rtx; }) _rtx; })
#define RTL_FLAG_CHECK3(RTX, C1, C2, C3) __extension__ \ #define RTL_FLAG_CHECK3(NAME, RTX, C1, C2, C3) __extension__ \
({ rtx const _rtx = (RTX); \ ({ rtx const _rtx = (RTX); \
if (GET_CODE(_rtx) != C1 && GET_CODE(_rtx) != C2 \ if (GET_CODE(_rtx) != C1 && GET_CODE(_rtx) != C2 \
&& GET_CODE(_rtx) != C3) \ && GET_CODE(_rtx) != C3) \
rtl_check_failed_flag (_rtx, __FILE__, __LINE__, __FUNCTION__); \ rtl_check_failed_flag (NAME, _rtx, __FILE__, __LINE__, \
__FUNCTION__); \
_rtx; }) _rtx; })
#define RTL_FLAG_CHECK4(RTX, C1, C2, C3, C4) __extension__ \ #define RTL_FLAG_CHECK4(NAME, RTX, C1, C2, C3, C4) __extension__ \
({ rtx const _rtx = (RTX); \ ({ rtx const _rtx = (RTX); \
if (GET_CODE(_rtx) != C1 && GET_CODE(_rtx) != C2 \ if (GET_CODE(_rtx) != C1 && GET_CODE(_rtx) != C2 \
&& GET_CODE(_rtx) != C3 && GET_CODE(_rtx) != C4) \ && GET_CODE(_rtx) != C3 && GET_CODE(_rtx) != C4) \
rtl_check_failed_flag (_rtx, __FILE__, __LINE__, __FUNCTION__); \ rtl_check_failed_flag (NAME, _rtx, __FILE__, __LINE__, \
__FUNCTION__); \
_rtx; }) _rtx; })
#define RTL_FLAG_CHECK5(RTX, C1, C2, C3, C4, C5) __extension__ \ #define RTL_FLAG_CHECK5(NAME, RTX, C1, C2, C3, C4, C5) __extension__ \
({ rtx const _rtx = (RTX); \ ({ rtx const _rtx = (RTX); \
if (GET_CODE(_rtx) != C1 && GET_CODE(_rtx) != C2 \ if (GET_CODE(_rtx) != C1 && GET_CODE(_rtx) != C2 \
&& GET_CODE(_rtx) != C3 && GET_CODE(_rtx) != C4 \ && GET_CODE(_rtx) != C3 && GET_CODE(_rtx) != C4 \
&& GET_CODE(_rtx) != C5) \ && GET_CODE(_rtx) != C5) \
rtl_check_failed_flag (_rtx, __FILE__, __LINE__, __FUNCTION__); \ rtl_check_failed_flag (NAME, _rtx, __FILE__, __LINE__, \
__FUNCTION__); \
_rtx; }) _rtx; })
#define RTL_FLAG_CHECK6(RTX, C1, C2, C3, C4, C5, C6) __extension__ \ #define RTL_FLAG_CHECK6(NAME, RTX, C1, C2, C3, C4, C5, C6) \
__extension__ \
({ rtx const _rtx = (RTX); \ ({ rtx const _rtx = (RTX); \
if (GET_CODE(_rtx) != C1 && GET_CODE(_rtx) != C2 \ if (GET_CODE(_rtx) != C1 && GET_CODE(_rtx) != C2 \
&& GET_CODE(_rtx) != C3 && GET_CODE(_rtx) != C4 \ && GET_CODE(_rtx) != C3 && GET_CODE(_rtx) != C4 \
&& GET_CODE(_rtx) != C5 && GET_CODE(_rtx) != C6) \ && GET_CODE(_rtx) != C5 && GET_CODE(_rtx) != C6) \
rtl_check_failed_flag (_rtx, __FILE__, __LINE__, __FUNCTION__); \ rtl_check_failed_flag (NAME,_rtx, __FILE__, __LINE__, \
__FUNCTION__); \
_rtx; }) _rtx; })
#define RTL_FLAG_CHECK7(RTX, C1, C2, C3, C4, C5, C6, C7) __extension__ \ #define RTL_FLAG_CHECK7(NAME, RTX, C1, C2, C3, C4, C5, C6, C7) \
__extension__ \
({ rtx const _rtx = (RTX); \ ({ rtx const _rtx = (RTX); \
if (GET_CODE(_rtx) != C1 && GET_CODE(_rtx) != C2 \ if (GET_CODE(_rtx) != C1 && GET_CODE(_rtx) != C2 \
&& GET_CODE(_rtx) != C3 && GET_CODE(_rtx) != C4 \ && GET_CODE(_rtx) != C3 && GET_CODE(_rtx) != C4 \
&& GET_CODE(_rtx) != C5 && GET_CODE(_rtx) != C6 \ && GET_CODE(_rtx) != C5 && GET_CODE(_rtx) != C6 \
&& GET_CODE(_rtx) != C7) \ && GET_CODE(_rtx) != C7) \
rtl_check_failed_flag (_rtx, __FILE__, __LINE__, __FUNCTION__); \ rtl_check_failed_flag (NAME, _rtx, __FILE__, __LINE__, \
__FUNCTION__); \
_rtx; }) _rtx; })
#define RTL_FLAG_CHECK8(RTX, C1, C2, C3, C4, C5, C6, C7, C8) __extension__ \ #define RTL_FLAG_CHECK8(NAME, RTX, C1, C2, C3, C4, C5, C6, C7, C8) \
__extension__ \
({ rtx const _rtx = (RTX); \ ({ rtx const _rtx = (RTX); \
if (GET_CODE(_rtx) != C1 && GET_CODE(_rtx) != C2 \ if (GET_CODE(_rtx) != C1 && GET_CODE(_rtx) != C2 \
&& GET_CODE(_rtx) != C3 && GET_CODE(_rtx) != C4 \ && GET_CODE(_rtx) != C3 && GET_CODE(_rtx) != C4 \
&& GET_CODE(_rtx) != C5 && GET_CODE(_rtx) != C6 \ && GET_CODE(_rtx) != C5 && GET_CODE(_rtx) != C6 \
&& GET_CODE(_rtx) != C7 && GET_CODE(_rtx) != C8) \ && GET_CODE(_rtx) != C7 && GET_CODE(_rtx) != C8) \
rtl_check_failed_flag (_rtx, __FILE__, __LINE__, __FUNCTION__); \ rtl_check_failed_flag (NAME, _rtx, __FILE__, __LINE__, \
__FUNCTION__); \
_rtx; }) _rtx; })
extern void rtl_check_failed_flag PARAMS ((rtx, const char *, int, extern void rtl_check_failed_flag PARAMS ((const char *, rtx, const char *,
const char *)) int, const char *))
ATTRIBUTE_NORETURN ATTRIBUTE_NORETURN
; ;
#else /* not ENABLE_RTL_FLAG_CHECKING */ #else /* not ENABLE_RTL_FLAG_CHECKING */
#define RTL_FLAG_CHECK1(RTX, C1) (RTX) #define RTL_FLAG_CHECK1(NAME, RTX, C1) (RTX)
#define RTL_FLAG_CHECK2(RTX, C1, C2) (RTX) #define RTL_FLAG_CHECK2(NAME, RTX, C1, C2) (RTX)
#define RTL_FLAG_CHECK3(RTX, C1, C2, C3) (RTX) #define RTL_FLAG_CHECK3(NAME, RTX, C1, C2, C3) (RTX)
#define RTL_FLAG_CHECK4(RTX, C1, C2, C3, C4) (RTX) #define RTL_FLAG_CHECK4(NAME, RTX, C1, C2, C3, C4) (RTX)
#define RTL_FLAG_CHECK5(RTX, C1, C2, C3, C4, C5) (RTX) #define RTL_FLAG_CHECK5(NAME, RTX, C1, C2, C3, C4, C5) (RTX)
#define RTL_FLAG_CHECK6(RTX, C1, C2, C3, C4, C5, C6) (RTX) #define RTL_FLAG_CHECK6(NAME, RTX, C1, C2, C3, C4, C5, C6) (RTX)
#define RTL_FLAG_CHECK7(RTX, C1, C2, C3, C4, C5, C6, C7) (RTX) #define RTL_FLAG_CHECK7(NAME, RTX, C1, C2, C3, C4, C5, C6, C7) (RTX)
#define RTL_FLAG_CHECK8(RTX, C1, C2, C3, C4, C5, C6, C7, C8) (RTX) #define RTL_FLAG_CHECK8(NAME, RTX, C1, C2, C3, C4, C5, C6, C7, C8) (RTX)
#endif #endif
#define CLEAR_RTX_FLAGS(RTX) \ #define CLEAR_RTX_FLAGS(RTX) \
...@@ -505,38 +516,46 @@ do { \ ...@@ -505,38 +516,46 @@ do { \
#define LOG_LINKS(INSN) XEXP(INSN, 5) #define LOG_LINKS(INSN) XEXP(INSN, 5)
#define RTX_INTEGRATED_P(RTX) \ #define RTX_INTEGRATED_P(RTX) \
(RTL_FLAG_CHECK8((RTX), INSN, CALL_INSN, JUMP_INSN, INSN_LIST, \ (RTL_FLAG_CHECK8("RTX_INTEGRATED_P", (RTX), INSN, CALL_INSN, \
BARRIER, CODE_LABEL, CONST, NOTE)->integrated) JUMP_INSN, INSN_LIST, BARRIER, CODE_LABEL, CONST, \
NOTE)->integrated)
#define RTX_UNCHANGING_P(RTX) \ #define RTX_UNCHANGING_P(RTX) \
(RTL_FLAG_CHECK3((RTX), REG, MEM, CONCAT)->unchanging) (RTL_FLAG_CHECK3("RTX_UNCHANGING_P", (RTX), REG, MEM, CONCAT)->unchanging)
#define RTX_FRAME_RELATED_P(RTX) \ #define RTX_FRAME_RELATED_P(RTX) \
(RTL_FLAG_CHECK5((RTX), INSN, CALL_INSN, JUMP_INSN, BARRIER, \ (RTL_FLAG_CHECK5("RTX_FRAME_RELATED_P", (RTX), INSN, CALL_INSN, \
SET)->frame_related) JUMP_INSN, BARRIER, SET)->frame_related)
/* 1 if insn has been deleted. */ /* 1 if RTX is an insn that has been deleted. */
#define INSN_DELETED_P(RTX) \ #define INSN_DELETED_P(RTX) \
(RTL_FLAG_CHECK6((RTX), INSN, CALL_INSN, JUMP_INSN, CODE_LABEL, \ (RTL_FLAG_CHECK6("INSN_DELETED_P", (RTX), INSN, CALL_INSN, JUMP_INSN, \
BARRIER, NOTE)->volatil) CODE_LABEL, BARRIER, NOTE)->volatil)
/* 1 if insn is a call to a const or pure function. */ /* 1 if RTX is a call to a const or pure function. */
#define CONST_OR_PURE_CALL_P(RTX) \ #define CONST_OR_PURE_CALL_P(RTX) \
(RTL_FLAG_CHECK3((RTX), CALL_INSN, NOTE, EXPR_LIST)->unchanging) (RTL_FLAG_CHECK3("CONST_OR_PURE_CALL_P", (RTX), CALL_INSN, NOTE, \
EXPR_LIST)->unchanging)
/* 1 if insn (assumed to be a CALL_INSN) is a sibling call. */
#define SIBLING_CALL_P(INSN) (RTL_FLAG_CHECK1((INSN), CALL_INSN)->jump) /* 1 if RTX is a call_insn for a sibling call. */
#define SIBLING_CALL_P(RTX) \
/* 1 in an INSN in the delay slot of a branch insn if an annulling branch (RTL_FLAG_CHECK1("SIBLING_CALL_P", (RTX), CALL_INSN)->jump)
should be used. */
#define INSN_ANNULLED_BRANCH_P(RTX) (RTL_FLAG_CHECK1((RTX), INSN)->unchanging) /* 1 if RTX is an insn in the delay slot of a branch insn for which an
annulling branch should be used. */
/* 1 if insn is a dead code. Valid only for dead-code elimination phase. */ #define INSN_ANNULLED_BRANCH_P(RTX) \
#define INSN_DEAD_CODE_P(RTX) (RTL_FLAG_CHECK1((RTX), INSN)->in_struct) (RTL_FLAG_CHECK2("INSN_ANNULLED_BRANCH_P", (RTX), INSN, \
JUMP_INSN)->unchanging)
/* 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 /* 1 if RTX is an insn that is dead code. Valid only for dead-code
elimination phase. */
#define INSN_DEAD_CODE_P(RTX) \
(RTL_FLAG_CHECK1("INSN_DEAD_CODE_P", (RTX), INSN)->in_struct)
/* 1 if RTX is an insn 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
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(RTX) (RTL_FLAG_CHECK1((RTX), INSN)->in_struct) #define INSN_FROM_TARGET_P(RTX) \
(RTL_FLAG_CHECK2("INSN_FROM_TARGET_P", (RTX), INSN, JUMP_INSN)->in_struct)
#define ADDR_DIFF_VEC_FLAGS(RTX) X0ADVFLAGS(RTX, 4) #define ADDR_DIFF_VEC_FLAGS(RTX) X0ADVFLAGS(RTX, 4)
...@@ -902,16 +921,17 @@ extern const char * const note_insn_name[NOTE_INSN_MAX - NOTE_INSN_BIAS]; ...@@ -902,16 +921,17 @@ extern const char * const note_insn_name[NOTE_INSN_MAX - NOTE_INSN_BIAS];
#define REGNO(RTX) XCUINT (RTX, 0, REG) #define REGNO(RTX) XCUINT (RTX, 0, REG)
#define ORIGINAL_REGNO(RTX) X0UINT (RTX, 1) #define ORIGINAL_REGNO(RTX) X0UINT (RTX, 1)
/* For a REG rtx, REG_FUNCTION_VALUE_P is nonzero if the reg /* 1 if RTX is a reg that is the current function's return value. */
is the current function's return value. */ #define REG_FUNCTION_VALUE_P(RTX) \
(RTL_FLAG_CHECK1("REG_FUNCTION_VALUE_P", (RTX), REG)->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 if RTX is a reg that corresponds to a variable declared by the user. */
#define REG_USERVAR_P(RTX) (RTL_FLAG_CHECK1((RTX), REG)->volatil) #define REG_USERVAR_P(RTX) \
(RTL_FLAG_CHECK1("REG_USERVAR_P", (RTX), REG)->volatil)
/* 1 in a REG rtx if the register is a pointer. */ /* 1 if RTX is a reg that holds a pointer value. */
#define REG_POINTER(RTX) (RTL_FLAG_CHECK1((RTX), REG)->frame_related) #define REG_POINTER(RTX) \
(RTL_FLAG_CHECK1("REG_POINTER", (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)))
...@@ -956,18 +976,20 @@ extern unsigned int subreg_regno_offset PARAMS ((unsigned int, ...@@ -956,18 +976,20 @@ extern unsigned int subreg_regno_offset PARAMS ((unsigned int,
enum machine_mode)); enum machine_mode));
extern unsigned int subreg_regno PARAMS ((rtx)); extern unsigned int subreg_regno PARAMS ((rtx));
/* 1 if the REG contained in SUBREG_REG is already known to be /* 1 if RTX is a subreg containing a reg that is already known to be
sign- or zero-extended from the mode of the SUBREG to the mode of sign- or zero-extended from the mode of the subreg to the mode of
the reg. SUBREG_PROMOTED_UNSIGNED_P gives the signedness of the the reg. SUBREG_PROMOTED_UNSIGNED_P gives the signedness of the
extension. extension.
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) (RTL_FLAG_CHECK1((RTX), SUBREG)->in_struct) #define SUBREG_PROMOTED_VAR_P(RTX) \
(RTL_FLAG_CHECK1("SUBREG_PROMOTED", (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); \ RTL_FLAG_CHECK1("SUBREG_PROMOTED_UNSIGNED_SET", (RTX), SUBREG); \
if ((VAL) < 0) \ if ((VAL) < 0) \
(RTX)->volatil = 1; \ (RTX)->volatil = 1; \
else { \ else { \
...@@ -976,7 +998,8 @@ do { \ ...@@ -976,7 +998,8 @@ do { \
} \ } \
} while (0) } while (0)
#define SUBREG_PROMOTED_UNSIGNED_P(RTX) \ #define SUBREG_PROMOTED_UNSIGNED_P(RTX) \
((RTL_FLAG_CHECK1((RTX), SUBREG)->volatil) ? -1 : (RTX)->unchanging) ((RTL_FLAG_CHECK1("SUBREG_PROMOTED_UNSIGNED_P", (RTX), SUBREG)->volatil) \
? -1 : (RTX)->unchanging)
/* Access various components of an ASM_OPERANDS rtx. */ /* Access various components of an ASM_OPERANDS rtx. */
...@@ -996,23 +1019,27 @@ do { \ ...@@ -996,23 +1019,27 @@ do { \
#define ASM_OPERANDS_SOURCE_FILE(RTX) XCSTR (RTX, 5, ASM_OPERANDS) #define ASM_OPERANDS_SOURCE_FILE(RTX) XCSTR (RTX, 5, ASM_OPERANDS)
#define ASM_OPERANDS_SOURCE_LINE(RTX) XCINT (RTX, 6, ASM_OPERANDS) #define ASM_OPERANDS_SOURCE_LINE(RTX) XCINT (RTX, 6, ASM_OPERANDS)
/* For a MEM RTX, 1 if we should keep the alias set for this mem /* 1 if RTX is a mem and 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) (RTL_FLAG_CHECK1((RTX), MEM)->jump) #define MEM_KEEP_ALIAS_SET_P(RTX) \
(RTL_FLAG_CHECK1("MEM_KEEP_ALIAS_SET_P", (RTX), MEM)->jump)
/* For a MEM rtx, 1 if it's a volatile reference. /* 1 if RTX is a mem or asm_operand for a volatile reference. */
Also in an ASM_OPERANDS rtx. */ #define MEM_VOLATILE_P(RTX) \
#define MEM_VOLATILE_P(RTX) (RTL_FLAG_CHECK2((RTX), MEM, ASM_OPERANDS)->volatil) (RTL_FLAG_CHECK3("MEM_VOLATILE_P", (RTX), MEM, ASM_OPERANDS, \
ASM_INPUT)->volatil)
/* For a MEM rtx, 1 if it refers to an aggregate, either to the /* 1 if RTX is a mem that 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) (RTL_FLAG_CHECK1((RTX), MEM)->in_struct) #define MEM_IN_STRUCT_P(RTX) \
(RTL_FLAG_CHECK1("MEM_IN_STRUCT_P", (RTX), MEM)->in_struct)
/* For a MEM rtx, 1 if it refers to a scalar. If zero, RTX may or may /* 1 if RTX is a mem that 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) (RTL_FLAG_CHECK1((RTX), MEM)->frame_related) #define MEM_SCALAR_P(RTX) \
(RTL_FLAG_CHECK1("MEM_SCALAR_P", (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
...@@ -1078,33 +1105,37 @@ do { \ ...@@ -1078,33 +1105,37 @@ do { \
MEM_KEEP_ALIAS_SET_P (LHS) = MEM_KEEP_ALIAS_SET_P (RHS), \ MEM_KEEP_ALIAS_SET_P (LHS) = MEM_KEEP_ALIAS_SET_P (RHS), \
MEM_ATTRS (LHS) = MEM_ATTRS (RHS)) MEM_ATTRS (LHS) = MEM_ATTRS (RHS))
/* For a LABEL_REF, 1 means that this reference is to a label outside the /* 1 if RTX is a label_ref to a label outside the loop containing the
loop containing the reference. */ reference. */
#define LABEL_OUTSIDE_LOOP_P(RTX) (RTL_FLAG_CHECK1((RTX), LABEL_REF)->in_struct) #define LABEL_OUTSIDE_LOOP_P(RTX) \
(RTL_FLAG_CHECK1("LABEL_OUTSIDE_LOOP_P", (RTX), LABEL_REF)->in_struct)
/* For a LABEL_REF, 1 means it is for a nonlocal label. */ /* 1 if RTX is a label_ref 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) \ #define LABEL_REF_NONLOCAL_P(RTX) \
(RTL_FLAG_CHECK2((RTX), LABEL_REF, REG_LABEL)->volatil) (RTL_FLAG_CHECK2("LABEL_REF_NONLOCAL_P", (RTX), LABEL_REF, \
REG_LABEL)->volatil)
/* For a CODE_LABEL, 1 means always consider this label to be needed. */ /* 1 if RTX is a code_label that should always be considered to be needed. */
#define LABEL_PRESERVE_P(RTX) \ #define LABEL_PRESERVE_P(RTX) \
(RTL_FLAG_CHECK2((RTX), CODE_LABEL, NOTE)->in_struct) (RTL_FLAG_CHECK2("LABEL_PRESERVE_P", (RTX), CODE_LABEL, NOTE)->in_struct)
/* For a REG, 1 means the register is used only in an exit test of a loop. */ /* 1 if RTX is a reg that is used only in an exit test of a loop. */
#define REG_LOOP_TEST_P(RTX) (RTL_FLAG_CHECK1((RTX), REG)->in_struct) #define REG_LOOP_TEST_P(RTX) \
(RTL_FLAG_CHECK1("REG_LOOP_TEST_P", (RTX), REG)->in_struct)
/* During sched, for an insn, 1 means that the insn must be scheduled together /* During sched, 1 if RTX is an insn that must be scheduled together
with the preceding insn. */ with the preceding insn. */
#define SCHED_GROUP_P(RTX) \ #define SCHED_GROUP_P(RTX) \
(RTL_FLAG_CHECK6((RTX), INSN, JUMP_INSN, CALL_INSN, CODE_LABEL, \ (RTL_FLAG_CHECK6("SCHED_GROUP_P", (RTX), INSN, JUMP_INSN, CALL_INSN, \
BARRIER, NOTE)->in_struct) 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) (RTL_FLAG_CHECK1((RTX), SET)->jump) #define SET_IS_RETURN_P(RTX) \
(RTL_FLAG_CHECK1("SET_IS_RETURN_P", (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)
...@@ -1116,22 +1147,27 @@ do { \ ...@@ -1116,22 +1147,27 @@ do { \
#define COND_EXEC_TEST(RTX) XCEXP (RTX, 0, COND_EXEC) #define COND_EXEC_TEST(RTX) XCEXP (RTX, 0, COND_EXEC)
#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 if RTX is a symbol_ref that addresses this function's constants pool. */
#define CONSTANT_POOL_ADDRESS_P(RTX) \ #define CONSTANT_POOL_ADDRESS_P(RTX) \
(RTL_FLAG_CHECK1((RTX), SYMBOL_REF)->unchanging) (RTL_FLAG_CHECK1("CONSTANT_POOL_ADDRESS_P", (RTX), SYMBOL_REF)->unchanging)
/* 1 in a SYMBOL_REF if it addresses this function's string constant pool. */ /* 1 if RTX is a symbol_ref that addresses this function's string constant
pool */
#define STRING_POOL_ADDRESS_P(RTX) \ #define STRING_POOL_ADDRESS_P(RTX) \
(RTL_FLAG_CHECK1((RTX), SYMBOL_REF)->frame_related) (RTL_FLAG_CHECK1("STRING_POOL_ADDRESS_P", (RTX), SYMBOL_REF)->frame_related)
/* Flag in a SYMBOL_REF for machine-specific purposes. */ /* Used if RTX is a symbol_ref, for machine-specific purposes. */
#define SYMBOL_REF_FLAG(RTX) (RTL_FLAG_CHECK1((RTX), SYMBOL_REF)->volatil) #define SYMBOL_REF_FLAG(RTX) \
(RTL_FLAG_CHECK1("SYMBOL_REF_FLAG", (RTX), SYMBOL_REF)->volatil)
/* 1 means a SYMBOL_REF has been the library function in emit_library_call. */ /* 1 if RTX is a symbol_ref that has been the library function in
#define SYMBOL_REF_USED(RTX) (RTL_FLAG_CHECK1((RTX), SYMBOL_REF)->used) emit_library_call. */
#define SYMBOL_REF_USED(RTX) \
(RTL_FLAG_CHECK1("SYMBOL_REF_USED", (RTX), SYMBOL_REF)->used)
/* 1 means a SYMBOL_REF is weak. */ /* 1 if RTX is a symbol_ref for a weak symbol. */
#define SYMBOL_REF_WEAK(RTX) (RTL_FLAG_CHECK1((RTX), SYMBOL_REF)->integrated) #define SYMBOL_REF_WEAK(RTX) \
(RTL_FLAG_CHECK1("SYMBOL_REF_WEAK", (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