This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: RTL type checking


On Fri, Aug 27, 1999 at 04:38:22PM -0700, Zack Weinberg wrote:
> Some of the fixes in here may not make terribly much sense.  If you
> are going to transform an RTX from one type to another - REG to MEM,
> for example - you must extract all the info you cared about from the
> REG before changing it, and initialize it as a MEM only after changing
> it.  This also comes up when deleting insns by turning them into
> NOTE_INSN_DELETED notes.

No big hardship there, I don't think.

> 1999-08-27 14:49 -0700  Zack Weinberg  <zack@bitmover.com>
> 
> 	* rtl.h (RTL_CHECK1, RTL_CHECK2): New macros, type check
> 	access against format if ENABLE_CHECKING is defined.
> 	(RTVEC_ELT): Bounds check access if ENABLE_CHECKING is
> 	defined.
> 	(XWINT, XINT, XSTR, XEXP, XVEC, XMODE, XBITMAP, XBBDEF):
> 	Define in terms of RTL_CHECK1/RTL_CHECK2 as appropriate.
> 	(XVECEXP, XVECLEN): Define in terms of RTVEC_ELT,
> 	GET_NUM_ELEM, and XVEC.
> 	(X0WINT, X0INT, X0STR, X0EXP, X0VEC, X0MODE, X0BITMAP, X0TREE,
> 	X0BBDEF, X0ADVFLAGS): New macros.  Type check for '0' slot
> 	instead of the normal slot type(s).
> 	(ADDR_DIFF_VEC_FLAGS): Use X0ADVFLAGS.
> 	(NOTE_SOURCE_FILE): Use X0STR.
> 	(NOTE_BLOCK_NUMBER, NOTE_EH_HANDLER, LABEL_NUSES,
> 	MEM_ALIAS_SET): Use X0INT.
> 	(NOTE_RANGE_INFO, NOTE_LIVE_INFO, NOTE_BASIC_BLOCK,
> 	JUMP_LABEL, LABEL_REFS, LABEL_NEXTREF, CONTAINING_INSN): Use
> 	X0EXP.
> 
> 	* rtl.c (copy_rtx, copy_most_rtx): Copy '0' slots using
> 	X0WINT.
> 	(rtl_check_failed_bounds, rtl_check_failed_type1,
> 	rtl_check_failed_type2, rtvec_check_failed_bounds): New
> 	functions.
> 
> 	* cse.c (canon_hash): Use XWINT for 'w' slots of a
> 	CONST_DOUBLE.
> 	(cse_insn): Decrement LABEL_NUSES for the target before
> 	deleting a jump, not after.
> 	* emit_rtl.c (gen_rtx_CONST_DOUBLE): Fill in slot 1 with
> 	X0EXP.
> 	* final.c (alter_subreg): When changing a SUBREG to a REG,
> 	compute the new regno before changing the RTX code, and set it
> 	in the RTX after changing the code.
> 	* flow.c (count_basic_blocks): Access 'w' slot with XWINT.
> 	(find_basic_blocks_1): Likewise.
> 	(delete_eh_regions): Use NOTE_EH_HANDLER not
> 	CODE_LABEL_NUMBER.
> 	* function.c (put_reg_into_stack): Change REG to MEM before
> 	initializing it as a MEM.
> 	(gen_mem_addressof): Likewise.
> 	(fixup_var_refs_insns): Save REG_NOTES of the insn so we can
> 	still use them after the insn is deleted.
> 	* integrate.c (copy_rtx_and_substitute): Copy '0' slots with
> 	X0WINT.
> 	* local-alloc.c (update_equiv_regs): Zap REG_NOTES before
> 	deleting an insn, not after.
> 	(block_alloc): Access PATTERN (insn) only if it is of class
> 	'i', and only if we need it (not REGISTER_CONSTRAINTS).
> 	Correct test for may_save_copy with REGISTER_CONSTRAINTS
> 	defined.
> 	* loop.c (check_dbra_loop): Verify bl->biv->add_val is a
> 	CONST_INT before using INTVAL on it.
> 	* print_rtl.c (print_rtx): Use X0STR.
> 	* real.h (CONST_DOUBLE_CHAIN): Use X0EXP.
> 	* regmove.c (fixup_match_1): Access PATTERN(insn) only if insn
> 	is class 'i'.
> 	* reload.c (loc_mentioned_in_p): Don't use XEXP when doing
> 	comparisons on RTL pointers.
> 	* reload1.c (reload): Turn REG into MEM before initializing it
> 	as a MEM.
> 	* varasm.c (mark_constant_pool): Skip CONST_DOUBLES in loop
> 	inspecting labels.
> 	* config/i386/i386.md (decrement_and_branch_until_zero+1
> 	anonymous insn): Fix typo.

Ok.


r~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]