aboutsummaryrefslogtreecommitdiff
path: root/gcc/function.c
diff options
context:
space:
mode:
authorZack Weinberg <zack@bitmover.com>1999-08-31 19:39:10 +0000
committerZack Weinberg <zack@gcc.gnu.org>1999-08-31 19:39:10 +0000
commitef178af3a4faba2594c5a106ca721a5c3db4f693 (patch)
tree0b67c4cdc852a2b9c74808c3b360549b5fc234f0 /gcc/function.c
parent8230525836955815b66b3e2a7a46fd6a0dbb7fd6 (diff)
downloadgcc-ef178af3a4faba2594c5a106ca721a5c3db4f693.zip
gcc-ef178af3a4faba2594c5a106ca721a5c3db4f693.tar.gz
gcc-ef178af3a4faba2594c5a106ca721a5c3db4f693.tar.bz2
rtl.h (RTL_CHECK1, RTL_CHECK2): New macros which type- and bounds- check RTL accesses if --enable-checking.
1999-08-31 12:20 -0700 Zack Weinberg <zack@bitmover.com> * rtl.h (RTL_CHECK1, RTL_CHECK2): New macros which type- and bounds- check RTL accesses if --enable-checking. (RTVEC_ELT): Bounds check if --enable-checking. (XWINT, XINT, XSTR, XEXP, XVEC, XMODE, XBITMAP, XTREE, XBBDEF): Use RTL_CHECK1/RTL_CHECK2 as appropriate. (XVECEXP, XVECLEN): Define in terms of XVEC, RTVEC_ELT, and GET_NUM_ELEM. (X0WINT, X0INT, X0STR, X0EXP, X0VEC, X0MODE, X0BITMAP, X0TREE, X0BBDEF, X0ADVFLAGS): New macros for accessing '0' slots of RTXes. (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. * real.h (CONST_DOUBLE_CHAIN): Use X0EXP. * rtl.c (copy_rtx, copy_most_rtx): Copy '0' slots with X0WINT. (rtl_check_failed_bounds, rtl_check_failed_type1, rtl_check_failed_type2, rtvec_check_failed_bounds): New functions. (fancy_abort): Fix comment. * cse.c (canon_hash): Read CONST_DOUBLE data slots with XWINT. (cse_insn): Decrement LABEL_NUSES for jump target before deleting jump insn. * emit-rtl.c (gen_rtx_CONST_DOUBLE): Use X0EXP for slot 1. * final.c (alter_subreg): Compute regno before changing x to REG; set REGNO(x) after changing it. * flow.c (count_basic_blocks): Use XWINT to inspect EH_REGION notes containing CONST_INTs. (delete_eh_regions): Use NOTE_EH_HANDLER. * function.c (put_reg_into_stack): Make reg a MEM before initializing it. (fixup_var_refs_insns): Save REG_NOTES (insn) in case we delete insn. (gen_mem_addressof): Make reg a MEM before initializing it. * 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): Only look at PATTERN(insn) if we have to, and only if it's format class 'i'. * loop.c (check_dbra_loop): Check bl->biv->add_val is a CONST_INT before using its INTVAL. * print-rtl.c (print_rtx): Use X0STR. * regmove.c (fixup_match_1): Don't look at PATTERN of non-class-'i' insn chain elements. * reload.c (loc_mentioned_in_p): Take address of in->fld[1].rtx directly. * reload1.c (reload): Change reg to a MEM before initializing it. * varasm.c (mark_constant_pool): Skip CONST_DOUBLES, which have no names. * config/i386/i386.md (decrement_and_branch_if_zero): Fix typo. From-SVN: r29008
Diffstat (limited to 'gcc/function.c')
-rw-r--r--gcc/function.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/gcc/function.c b/gcc/function.c
index 074252c..6fb5368 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -1341,11 +1341,11 @@ put_reg_into_stack (function, reg, type, promoted_mode, decl_mode, volatile_p,
new = assign_stack_local (decl_mode, GET_MODE_SIZE (decl_mode), 0);
}
+ PUT_CODE (reg, MEM);
PUT_MODE (reg, decl_mode);
XEXP (reg, 0) = XEXP (new, 0);
/* `volatil' bit means one thing for MEMs, another entirely for REGs. */
MEM_VOLATILE_P (reg) = volatile_p;
- PUT_CODE (reg, MEM);
/* If this is a memory ref that contains aggregate components,
mark it as such for cse and loop optimize. If we are reusing a
@@ -1495,6 +1495,9 @@ fixup_var_refs_insns (var, promoted_mode, unsignedp, insn, toplevel, ht)
if (GET_RTX_CLASS (GET_CODE (insn)) == 'i')
{
+ /* Remember the notes in case we delete the insn. */
+ note = REG_NOTES (insn);
+
/* If this is a CLOBBER of VAR, delete it.
If it has a REG_LIBCALL note, delete the REG_LIBCALL
@@ -1653,10 +1656,13 @@ fixup_var_refs_insns (var, promoted_mode, unsignedp, insn, toplevel, ht)
/* Also fix up any invalid exprs in the REG_NOTES of this insn.
But don't touch other insns referred to by reg-notes;
we will get them elsewhere. */
- for (note = REG_NOTES (insn); note; note = XEXP (note, 1))
- if (GET_CODE (note) != INSN_LIST)
- XEXP (note, 0)
- = walk_fixup_memory_subreg (XEXP (note, 0), insn, 1);
+ while (note)
+ {
+ if (GET_CODE (note) != INSN_LIST)
+ XEXP (note, 0)
+ = walk_fixup_memory_subreg (XEXP (note, 0), insn, 1);
+ note = XEXP (note, 1);
+ }
}
if (!ht)
@@ -2631,9 +2637,9 @@ gen_mem_addressof (reg, decl)
address is being taken. */
REG_USERVAR_P (XEXP (r, 0)) = REG_USERVAR_P (reg);
- XEXP (reg, 0) = r;
PUT_CODE (reg, MEM);
PUT_MODE (reg, DECL_MODE (decl));
+ XEXP (reg, 0) = r;
MEM_VOLATILE_P (reg) = TREE_SIDE_EFFECTS (decl);
MEM_SET_IN_STRUCT_P (reg, AGGREGATE_TYPE_P (type));
MEM_ALIAS_SET (reg) = get_alias_set (decl);