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>
* 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.
2002-05-06 Roger Sayle <roger@eyesopen.com>
......
......@@ -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;
pat = find_reg_note (insn, REG_FRAME_RELATED_EXPR, NULL_RTX);
......
......@@ -1160,9 +1160,9 @@ reload (first, global)
{
rtx reg = regno_reg_rtx[i];
REG_USERVAR_P (reg) = 0;
PUT_CODE (reg, MEM);
XEXP (reg, 0) = addr;
REG_USERVAR_P (reg) = 0;
if (reg_equiv_memory_loc[i])
MEM_COPY_ATTRIBUTES (reg, reg_equiv_memory_loc[i]);
else
......@@ -8079,7 +8079,8 @@ reload_cse_simplify (insn)
if (!count && reload_cse_noop_set_p (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;
reload_cse_delete_noop_set (insn, value);
return;
......
......@@ -331,13 +331,13 @@ copy_rtx (orig)
/* We do not copy the USED flag, which is used as a mark bit during
walks over the RTL. */
copy->used = 0;
RTX_FLAG (copy, used) = 0;
/* We do not copy FRAME_RELATED for INSNs. */
if (GET_RTX_CLASS (code) == 'i')
copy->frame_related = 0;
copy->jump = orig->jump;
copy->call = orig->call;
RTX_FLAG (copy, frame_related) = 0;
RTX_FLAG (copy, jump) = RTX_FLAG (orig, jump);
RTX_FLAG (copy, call) = RTX_FLAG (orig, call);
format_ptr = GET_RTX_FORMAT (GET_CODE (copy));
......@@ -390,11 +390,11 @@ shallow_copy_rtx (orig)
rtx copy = rtx_alloc (code);
PUT_MODE (copy, GET_MODE (orig));
copy->in_struct = orig->in_struct;
copy->volatil = orig->volatil;
copy->unchanging = orig->unchanging;
copy->integrated = orig->integrated;
copy->frame_related = orig->frame_related;
RTX_FLAG (copy, in_struct) = RTX_FLAG (orig, in_struct);
RTX_FLAG (copy, volatil) = RTX_FLAG (orig, volatil);
RTX_FLAG (copy, unchanging) = RTX_FLAG (orig, unchanging);
RTX_FLAG (copy, integrated) = RTX_FLAG (orig, integrated);
RTX_FLAG (copy, frame_related) = RTX_FLAG (orig, frame_related);
for (i = 0; i < GET_RTX_LENGTH (code); i++)
copy->fld[i] = orig->fld[i];
......@@ -637,3 +637,17 @@ rtvec_check_failed_bounds (r, n, file, line, func)
n, GET_NUM_ELEM (r) - 1, func, trim_filename (file), line);
}
#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 */
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