diff options
author | Richard Henderson <rth@redhat.com> | 2004-08-18 01:25:01 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2004-08-18 01:25:01 -0700 |
commit | 389fdba06a4469967a53ea92ffa86d1d090e3a7f (patch) | |
tree | c1f08db698e4a92a83942e9db41831c4c159bfb0 /gcc/config | |
parent | 17ad5b5ec26d9c6d7edc84c89d69931552d138ff (diff) | |
download | gcc-389fdba06a4469967a53ea92ffa86d1d090e3a7f.zip gcc-389fdba06a4469967a53ea92ffa86d1d090e3a7f.tar.gz gcc-389fdba06a4469967a53ea92ffa86d1d090e3a7f.tar.bz2 |
rtl.h (MEM_READONLY_P): Replace RTX_UNCHANGING_P.
* rtl.h (MEM_READONLY_P): Replace RTX_UNCHANGING_P.
* alias.c (true_dependence): Update to match new semantics.
(canon_true_dependence, write_dependence_p): Likewise.
(anti_dependence, output_dependence): Update write_dependence_p args.
(unchanging_anti_dependence): Remove.
* calls.c (purge_mem_unchanging_flag): Remove.
(fixup_tail_calls): Don't call it.
(expand_call): Don't add unchanging memory to function usage.
* expr.c (emit_block_move_via_libcall): Likewise.
(clear_storage_via_libcall): Don't clobber RTX_UNCHANGING_P mems.
(get_subtarget): Don't use RTX_UNCHANGING_P.
(expand_assignment, store_constructor, expand_expr_real_1): Likewise.
(do_tablejump): Set MEM_READONLY_P, not RTX_UNCHANGING_P.
* combine.c (get_last_value_validate): Use MEM_READONLY_P.
* cse.c (insert): Don't use RTX_UNCHANGING_P.
(cse_insn, canon_hash): Use MEM_READONLY_P.
* emit-rtl.c (set_mem_attributes_minus_bitpos): Use MEM_READONLY_P
instead of RTX_UNCHANGING_P.
* explow.c (maybe_set_unchanging): Remove.
* expr.h (maybe_set_unchanging): Remove.
* flow.c (insn_dead_p, mark_used_regs): Use anti_dependence.
* function.c (assign_stack_temp_for_type): Don't use RTX_UNCHANGING_P.
(assign_parm_setup_reg, expand_function_start): Likewise.
* integrate.c (copy_rtx_and_substitute): Likewise.
* ra-rewrite.c (emit_colors): Likewise.
* regmove.c (copy_src_to_dest, regmove_optimize): Likewise.
(fixup_match_1): Likewise.
* reload1.c (reload, alter_reg): Likewise.
* local-alloc.c (validate_equiv_mem): Check MEM_READONLY_P,
not RTX_UNCHANGING_P.
(equiv_init_varies_p): Likewise.
* loop-invariant.c (check_maybe_invariant): Likewise.
* resource.c (mark_referenced_resources, mark_set_resources): Likewise.
* loop.c (note_addr_stored): Likewise.
(prescan_loop): Likewise. Don't check function usage for clobbered
unchanging memory.
* rtlanal.c (rtx_unstable_p): Check MEM_READONLY_P,
not RTX_UNCHANGING_P.
(rtx_varies_p, modified_between_p, modified_in_p): Likewise.
* varasm.c (force_const_mem): Likewise.
* stmt.c (expand_decl): Don't set RTX_UNCHANGING_P.
* web.c (entry_register): Likewise.
* tree-gimple.h (get_base_address): Move decl ...
* tree.h: ... here.
* doc/rtl.texi (MEM_READONLY_P): Replace RTX_UNCHANGING_P.
* config/alpha/alpha.c (alpha_set_memflags_1): Rewrite to be
called via for_each_rtx. Copy MEM_SCALAR_P, MEM_NOTRAP_P too.
(alpha_set_memflags): Update to match.
* config/darwin.c (machopic_indirect_data_reference): Set
MEM_READONLY_P instead of RTX_UNCHANGING_P.
(machopic_indirect_call_target): Likewise.
(machopic_legitimize_pic_address): Likewise.
* config/arm/arm.c (legitimize_pic_address, arm_gen_load_multiple,
arm_gen_store_multiple, arm_gen_movmemqi): Likewise.
* config/arm/arm.md (load_multiple, store_multiple): Likewise.
* config/frv/frv.md (symGOT2reg): Likewise.
* config/i386/i386.c (legitimize_pic_address,
legitimize_tls_address, ix86_split_to_parts): Likewise.
* config/ia64/ia64.c (ia64_expand_tls_address): Likewise.
* config/ia64/ia64.md (load_fptr): Likewise.
* config/m32r/m32r.c (m32r_legitimize_pic_address): Likewise.
* config/m68k/m68k.c (legitimize_pic_address): Likewise.
* config/mcore/mcore.c (block_move_sequence): Likewise.
* config/mn10300/mn10300.md (symGOT2reg): Likewise.
* config/pa/pa.c (legitimize_pic_address): Likewise.
* config/rs6000/rs6000.c (rs6000_legitimize_tls_address): Likewise.
(rs6000_emit_move): Likewise.
* config/s390/s390.c (legitimize_pic_address): Likewise.
(legitimize_tls_address): Likewise.
* config/s390/s390.md (casesi): Likewise.
* config/sh/sh.c (prepare_move_operands, sh_reorg): Likewise.
* config/sh/sh.md (symGOT2reg): Likewise.
* config/sparc/sparc.c (legitimize_pic_address): Likewise.
* config/v850/v850.md (casesi): Likewise.
* config/ia64/ia64.c (gen_thread_pointer): Don't set RTX_UNCHANGING_P.
* config/iq2000/iq2000.c (save_restore_insns): Likewise.
* config/mips/mips.c (mips_restore_gp): Likewise.
(mips_save_restore_reg, mips16_gp_pseudo_reg): Likewise.
* config/sh/sh.c (sh_reorg): Likewise.
From-SVN: r86178
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/alpha/alpha.c | 71 | ||||
-rw-r--r-- | gcc/config/arm/arm.c | 28 | ||||
-rw-r--r-- | gcc/config/arm/arm.md | 8 | ||||
-rw-r--r-- | gcc/config/darwin.c | 19 | ||||
-rw-r--r-- | gcc/config/frv/frv.md | 2 | ||||
-rw-r--r-- | gcc/config/i386/i386.c | 8 | ||||
-rw-r--r-- | gcc/config/ia64/ia64.c | 13 | ||||
-rw-r--r-- | gcc/config/ia64/ia64.md | 2 | ||||
-rw-r--r-- | gcc/config/iq2000/iq2000.c | 3 | ||||
-rw-r--r-- | gcc/config/m32r/m32r.c | 2 | ||||
-rw-r--r-- | gcc/config/m68k/m68k.c | 2 | ||||
-rw-r--r-- | gcc/config/mcore/mcore.c | 4 | ||||
-rw-r--r-- | gcc/config/mips/mips.c | 4 | ||||
-rw-r--r-- | gcc/config/mn10300/mn10300.md | 2 | ||||
-rw-r--r-- | gcc/config/pa/pa.c | 2 | ||||
-rw-r--r-- | gcc/config/rs6000/rs6000.c | 4 | ||||
-rw-r--r-- | gcc/config/s390/s390.c | 14 | ||||
-rw-r--r-- | gcc/config/s390/s390.md | 2 | ||||
-rw-r--r-- | gcc/config/sh/sh.c | 5 | ||||
-rw-r--r-- | gcc/config/sh/sh.md | 2 | ||||
-rw-r--r-- | gcc/config/sparc/sparc.c | 2 | ||||
-rw-r--r-- | gcc/config/v850/v850.md | 2 |
22 files changed, 83 insertions, 118 deletions
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c index 87d2cf52..6252e88 100644 --- a/gcc/config/alpha/alpha.c +++ b/gcc/config/alpha/alpha.c @@ -1589,48 +1589,27 @@ secondary_reload_class (enum reg_class class, enum machine_mode mode, /* Subfunction of the following function. Update the flags of any MEM found in part of X. */ -static void -alpha_set_memflags_1 (rtx x, int in_struct_p, int volatile_p, int unchanging_p) +static int +alpha_set_memflags_1 (rtx *xp, void *data) { - int i; - - switch (GET_CODE (x)) - { - case SEQUENCE: - abort (); - - case PARALLEL: - for (i = XVECLEN (x, 0) - 1; i >= 0; i--) - alpha_set_memflags_1 (XVECEXP (x, 0, i), in_struct_p, volatile_p, - unchanging_p); - break; + rtx x = *xp, orig = (rtx) data; - case INSN: - alpha_set_memflags_1 (PATTERN (x), in_struct_p, volatile_p, - unchanging_p); - break; + if (GET_CODE (x) != MEM) + return 0; - case SET: - alpha_set_memflags_1 (SET_DEST (x), in_struct_p, volatile_p, - unchanging_p); - alpha_set_memflags_1 (SET_SRC (x), in_struct_p, volatile_p, - unchanging_p); - break; + MEM_VOLATILE_P (x) = MEM_VOLATILE_P (orig); + MEM_IN_STRUCT_P (x) = MEM_IN_STRUCT_P (orig); + MEM_SCALAR_P (x) = MEM_SCALAR_P (orig); + MEM_NOTRAP_P (x) = MEM_NOTRAP_P (orig); + MEM_READONLY_P (x) = MEM_READONLY_P (orig); - case MEM: - MEM_IN_STRUCT_P (x) = in_struct_p; - MEM_VOLATILE_P (x) = volatile_p; - RTX_UNCHANGING_P (x) = unchanging_p; - /* Sadly, we cannot use alias sets because the extra aliasing - produced by the AND interferes. Given that two-byte quantities - are the only thing we would be able to differentiate anyway, - there does not seem to be any point in convoluting the early - out of the alias check. */ - break; + /* Sadly, we cannot use alias sets because the extra aliasing + produced by the AND interferes. Given that two-byte quantities + are the only thing we would be able to differentiate anyway, + there does not seem to be any point in convoluting the early + out of the alias check. */ - default: - break; - } + return -1; } /* Given INSN, which is an INSN list or the PATTERN of a single insn @@ -1642,22 +1621,26 @@ alpha_set_memflags_1 (rtx x, int in_struct_p, int volatile_p, int unchanging_p) void alpha_set_memflags (rtx insn, rtx ref) { - int in_struct_p, volatile_p, unchanging_p; + rtx *base_ptr; if (GET_CODE (ref) != MEM) return; - in_struct_p = MEM_IN_STRUCT_P (ref); - volatile_p = MEM_VOLATILE_P (ref); - unchanging_p = RTX_UNCHANGING_P (ref); - /* This is only called from alpha.md, after having had something generated from one of the insn patterns. So if everything is zero, the pattern is already up-to-date. */ - if (! in_struct_p && ! volatile_p && ! unchanging_p) + if (!MEM_VOLATILE_P (ref) + && !MEM_IN_STRUCT_P (ref) + && !MEM_SCALAR_P (ref) + && !MEM_NOTRAP_P (ref) + && !MEM_READONLY_P (ref)) return; - alpha_set_memflags_1 (insn, in_struct_p, volatile_p, unchanging_p); + if (INSN_P (insn)) + base_ptr = &PATTERN (insn); + else + base_ptr = &insn; + for_each_rtx (base_ptr, alpha_set_memflags_1, (void *) ref); } /* Internal routine for alpha_emit_set_const to check for N or below insns. */ diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index c4d9ffd..fb96c38 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -2924,7 +2924,7 @@ legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg) pic_ref = gen_rtx_MEM (Pmode, gen_rtx_PLUS (Pmode, pic_offset_table_rtx, address)); - RTX_UNCHANGING_P (pic_ref) = 1; + MEM_READONLY_P (pic_ref) = 1; } insn = emit_move_insn (reg, pic_ref); @@ -5939,7 +5939,7 @@ arm_gen_load_multiple (int base_regno, int count, rtx from, int up, for (i = 0; i < count; i++) { mem = gen_rtx_MEM (SImode, plus_constant (from, i * 4 * sign)); - RTX_UNCHANGING_P (mem) = unchanging_p; + MEM_READONLY_P (mem) = unchanging_p; MEM_IN_STRUCT_P (mem) = in_struct_p; MEM_SCALAR_P (mem) = scalar_p; emit_move_insn (gen_rtx_REG (SImode, base_regno + i), mem); @@ -5968,7 +5968,7 @@ arm_gen_load_multiple (int base_regno, int count, rtx from, int up, for (j = 0; i < count; i++, j++) { mem = gen_rtx_MEM (SImode, plus_constant (from, j * 4 * sign)); - RTX_UNCHANGING_P (mem) = unchanging_p; + MEM_READONLY_P (mem) = unchanging_p; MEM_IN_STRUCT_P (mem) = in_struct_p; MEM_SCALAR_P (mem) = scalar_p; XVECEXP (result, 0, i) @@ -5999,7 +5999,7 @@ arm_gen_store_multiple (int base_regno, int count, rtx to, int up, for (i = 0; i < count; i++) { mem = gen_rtx_MEM (SImode, plus_constant (to, i * 4 * sign)); - RTX_UNCHANGING_P (mem) = unchanging_p; + MEM_READONLY_P (mem) = unchanging_p; MEM_IN_STRUCT_P (mem) = in_struct_p; MEM_SCALAR_P (mem) = scalar_p; emit_move_insn (mem, gen_rtx_REG (SImode, base_regno + i)); @@ -6028,7 +6028,7 @@ arm_gen_store_multiple (int base_regno, int count, rtx to, int up, for (j = 0; i < count; i++, j++) { mem = gen_rtx_MEM (SImode, plus_constant (to, j * 4 * sign)); - RTX_UNCHANGING_P (mem) = unchanging_p; + MEM_READONLY_P (mem) = unchanging_p; MEM_IN_STRUCT_P (mem) = in_struct_p; MEM_SCALAR_P (mem) = scalar_p; @@ -6060,10 +6060,10 @@ arm_gen_movmemqi (rtx *operands) st_dst = XEXP (operands[0], 0); st_src = XEXP (operands[1], 0); - dst_unchanging_p = RTX_UNCHANGING_P (operands[0]); + dst_unchanging_p = MEM_READONLY_P (operands[0]); dst_in_struct_p = MEM_IN_STRUCT_P (operands[0]); dst_scalar_p = MEM_SCALAR_P (operands[0]); - src_unchanging_p = RTX_UNCHANGING_P (operands[1]); + src_unchanging_p = MEM_READONLY_P (operands[1]); src_in_struct_p = MEM_IN_STRUCT_P (operands[1]); src_scalar_p = MEM_SCALAR_P (operands[1]); @@ -6107,7 +6107,7 @@ arm_gen_movmemqi (rtx *operands) else { mem = gen_rtx_MEM (SImode, dst); - RTX_UNCHANGING_P (mem) = dst_unchanging_p; + MEM_READONLY_P (mem) = dst_unchanging_p; MEM_IN_STRUCT_P (mem) = dst_in_struct_p; MEM_SCALAR_P (mem) = dst_scalar_p; emit_move_insn (mem, gen_rtx_REG (SImode, 0)); @@ -6126,14 +6126,14 @@ arm_gen_movmemqi (rtx *operands) rtx sreg; mem = gen_rtx_MEM (SImode, src); - RTX_UNCHANGING_P (mem) = src_unchanging_p; + MEM_READONLY_P (mem) = src_unchanging_p; MEM_IN_STRUCT_P (mem) = src_in_struct_p; MEM_SCALAR_P (mem) = src_scalar_p; emit_move_insn (sreg = gen_reg_rtx (SImode), mem); emit_move_insn (fin_src = gen_reg_rtx (SImode), plus_constant (src, 4)); mem = gen_rtx_MEM (SImode, dst); - RTX_UNCHANGING_P (mem) = dst_unchanging_p; + MEM_READONLY_P (mem) = dst_unchanging_p; MEM_IN_STRUCT_P (mem) = dst_in_struct_p; MEM_SCALAR_P (mem) = dst_scalar_p; emit_move_insn (mem, sreg); @@ -6150,7 +6150,7 @@ arm_gen_movmemqi (rtx *operands) abort (); mem = gen_rtx_MEM (SImode, src); - RTX_UNCHANGING_P (mem) = src_unchanging_p; + MEM_READONLY_P (mem) = src_unchanging_p; MEM_IN_STRUCT_P (mem) = src_in_struct_p; MEM_SCALAR_P (mem) = src_scalar_p; part_bytes_reg = copy_to_mode_reg (SImode, mem); @@ -6171,7 +6171,7 @@ arm_gen_movmemqi (rtx *operands) while (last_bytes) { mem = gen_rtx_MEM (QImode, plus_constant (dst, last_bytes - 1)); - RTX_UNCHANGING_P (mem) = dst_unchanging_p; + MEM_READONLY_P (mem) = dst_unchanging_p; MEM_IN_STRUCT_P (mem) = dst_in_struct_p; MEM_SCALAR_P (mem) = dst_scalar_p; emit_move_insn (mem, gen_lowpart (QImode, part_bytes_reg)); @@ -6190,7 +6190,7 @@ arm_gen_movmemqi (rtx *operands) if (last_bytes > 1) { mem = gen_rtx_MEM (HImode, dst); - RTX_UNCHANGING_P (mem) = dst_unchanging_p; + MEM_READONLY_P (mem) = dst_unchanging_p; MEM_IN_STRUCT_P (mem) = dst_in_struct_p; MEM_SCALAR_P (mem) = dst_scalar_p; emit_move_insn (mem, gen_lowpart (HImode, part_bytes_reg)); @@ -6208,7 +6208,7 @@ arm_gen_movmemqi (rtx *operands) if (last_bytes) { mem = gen_rtx_MEM (QImode, dst); - RTX_UNCHANGING_P (mem) = dst_unchanging_p; + MEM_READONLY_P (mem) = dst_unchanging_p; MEM_IN_STRUCT_P (mem) = dst_in_struct_p; MEM_SCALAR_P (mem) = dst_scalar_p; emit_move_insn (mem, gen_lowpart (QImode, part_bytes_reg)); diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md index 351ce2b..6346960 100644 --- a/gcc/config/arm/arm.md +++ b/gcc/config/arm/arm.md @@ -5258,8 +5258,8 @@ operands[3] = arm_gen_load_multiple (REGNO (operands[0]), INTVAL (operands[2]), force_reg (SImode, XEXP (operands[1], 0)), - TRUE, FALSE, RTX_UNCHANGING_P(operands[1]), - MEM_IN_STRUCT_P(operands[1]), + TRUE, FALSE, MEM_READONLY_P (operands[1]), + MEM_IN_STRUCT_P (operands[1]), MEM_SCALAR_P (operands[1])); " ) @@ -5380,8 +5380,8 @@ operands[3] = arm_gen_store_multiple (REGNO (operands[1]), INTVAL (operands[2]), force_reg (SImode, XEXP (operands[0], 0)), - TRUE, FALSE, RTX_UNCHANGING_P (operands[0]), - MEM_IN_STRUCT_P(operands[0]), + TRUE, FALSE, MEM_READONLY_P (operands[0]), + MEM_IN_STRUCT_P (operands[0]), MEM_SCALAR_P (operands[0])); " ) diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c index bca5513..e3a4cfd 100644 --- a/gcc/config/darwin.c +++ b/gcc/config/darwin.c @@ -385,7 +385,7 @@ machopic_indirect_data_reference (rtx orig, rtx reg) SYMBOL_REF_DECL (ptr_ref) = SYMBOL_REF_DECL (orig); ptr_ref = gen_rtx_MEM (Pmode, ptr_ref); - RTX_UNCHANGING_P (ptr_ref) = 1; + MEM_READONLY_P (ptr_ref) = 1; return ptr_ref; } @@ -469,7 +469,7 @@ machopic_indirect_call_target (rtx target) XEXP (target, 0) = gen_rtx_SYMBOL_REF (mode, stub_name); SYMBOL_REF_DECL (XEXP (target, 0)) = decl; - RTX_UNCHANGING_P (target) = 1; + MEM_READONLY_P (target) = 1; } return target; @@ -532,7 +532,7 @@ machopic_legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg) emit_insn (gen_macho_high (temp_reg, asym)); mem = gen_rtx_MEM (GET_MODE (orig), gen_rtx_LO_SUM (Pmode, temp_reg, asym)); - RTX_UNCHANGING_P (mem) = 1; + MEM_READONLY_P (mem) = 1; emit_insn (gen_rtx_SET (VOIDmode, reg, mem)); #else /* Some other CPU -- WriteMe! but right now there are no other platform that can use dynamic-no-pic */ @@ -565,7 +565,7 @@ machopic_legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg) mem = gen_rtx_MEM (GET_MODE (orig), gen_rtx_LO_SUM (Pmode, hi_sum_reg, offset)); - RTX_UNCHANGING_P (mem) = 1; + MEM_READONLY_P (mem) = 1; insn = emit_insn (gen_rtx_SET (VOIDmode, reg, mem)); REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_EQUAL, pic_ref, REG_NOTES (insn)); @@ -614,7 +614,7 @@ machopic_legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg) emit_move_insn (reg, pic_ref); pic_ref = gen_rtx_MEM (GET_MODE (orig), reg); #endif - RTX_UNCHANGING_P (pic_ref) = 1; + MEM_READONLY_P (pic_ref) = 1; } else { @@ -650,7 +650,6 @@ machopic_legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg) gen_rtx_LO_SUM (Pmode, hi_sum_reg, offset))); pic_ref = reg; - RTX_UNCHANGING_P (pic_ref) = 1; #else emit_insn (gen_rtx_SET (VOIDmode, reg, gen_rtx_HIGH (Pmode, offset))); @@ -658,7 +657,6 @@ machopic_legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg) gen_rtx_LO_SUM (Pmode, reg, offset))); pic_ref = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, reg); - RTX_UNCHANGING_P (pic_ref) = 1; #endif } else @@ -732,9 +730,6 @@ machopic_legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg) else pic_ref = gen_rtx_PLUS (Pmode, base, orig); - if (RTX_UNCHANGING_P (base) && RTX_UNCHANGING_P (orig)) - RTX_UNCHANGING_P (pic_ref) = 1; - if (reg && is_complex) { emit_move_insn (reg, pic_ref); @@ -752,9 +747,7 @@ machopic_legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg) && GET_CODE (XEXP (orig, 0)) == SYMBOL_REF) { rtx addr = machopic_legitimize_pic_address (XEXP (orig, 0), Pmode, reg); - - addr = gen_rtx_MEM (GET_MODE (orig), addr); - RTX_UNCHANGING_P (addr) = RTX_UNCHANGING_P (orig); + addr = replace_equiv_address (orig, addr); emit_move_insn (reg, addr); pic_ref = reg; } diff --git a/gcc/config/frv/frv.md b/gcc/config/frv/frv.md index 9c78898..c77472d 100644 --- a/gcc/config/frv/frv.md +++ b/gcc/config/frv/frv.md @@ -7719,7 +7719,7 @@ insn = emit_insn (gen_symGOT2reg_i (operands[0], operands[1], operands[2], operands[3])); - RTX_UNCHANGING_P (SET_SRC (PATTERN (insn))) = 1; + MEM_READONLY_P (SET_SRC (PATTERN (insn))) = 1; REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_EQUAL, operands[1], REG_NOTES (insn)); diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index f8a0b00..9080767 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -5307,7 +5307,7 @@ legitimize_pic_address (rtx orig, rtx reg) new = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, addr), UNSPEC_GOTPCREL); new = gen_rtx_CONST (Pmode, new); new = gen_rtx_MEM (Pmode, new); - RTX_UNCHANGING_P (new) = 1; + MEM_READONLY_P (new) = 1; set_mem_alias_set (new, ix86_GOT_alias_set ()); if (reg == 0) @@ -5329,7 +5329,7 @@ legitimize_pic_address (rtx orig, rtx reg) new = gen_rtx_CONST (Pmode, new); new = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, new); new = gen_rtx_MEM (Pmode, new); - RTX_UNCHANGING_P (new) = 1; + MEM_READONLY_P (new) = 1; set_mem_alias_set (new, ix86_GOT_alias_set ()); if (reg == 0) @@ -5509,7 +5509,7 @@ legitimize_tls_address (rtx x, enum tls_model model, int for_mov) if (pic) off = gen_rtx_PLUS (Pmode, pic, off); off = gen_rtx_MEM (Pmode, off); - RTX_UNCHANGING_P (off) = 1; + MEM_READONLY_P (off) = 1; set_mem_alias_set (off, ix86_GOT_alias_set ()); if (TARGET_64BIT || TARGET_GNU_TLS) @@ -9552,7 +9552,7 @@ ix86_split_to_parts (rtx operand, rtx *parts, enum machine_mode mode) /* Optimize constant pool reference to immediates. This is used by fp moves, that force all constants to memory to allow combining. */ - if (GET_CODE (operand) == MEM && RTX_UNCHANGING_P (operand)) + if (GET_CODE (operand) == MEM && MEM_READONLY_P (operand)) { rtx tmp = maybe_get_pool_constant (operand); if (tmp) diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c index f4b45d3..f786f33 100644 --- a/gcc/config/ia64/ia64.c +++ b/gcc/config/ia64/ia64.c @@ -669,10 +669,7 @@ static rtx gen_thread_pointer (void) { if (!thread_pointer_rtx) - { - thread_pointer_rtx = gen_rtx_REG (Pmode, 13); - RTX_UNCHANGING_P (thread_pointer_rtx) = 1; - } + thread_pointer_rtx = gen_rtx_REG (Pmode, 13); return thread_pointer_rtx; } @@ -690,12 +687,12 @@ ia64_expand_tls_address (enum tls_model tls_kind, rtx op0, rtx op1) tga_op1 = gen_reg_rtx (Pmode); emit_insn (gen_load_ltoff_dtpmod (tga_op1, op1)); tga_op1 = gen_rtx_MEM (Pmode, tga_op1); - RTX_UNCHANGING_P (tga_op1) = 1; + MEM_READONLY_P (tga_op1) = 1; tga_op2 = gen_reg_rtx (Pmode); emit_insn (gen_load_ltoff_dtprel (tga_op2, op1)); tga_op2 = gen_rtx_MEM (Pmode, tga_op2); - RTX_UNCHANGING_P (tga_op2) = 1; + MEM_READONLY_P (tga_op2) = 1; tga_ret = emit_library_call_value (gen_tls_get_addr (), NULL_RTX, LCT_CONST, Pmode, 2, tga_op1, @@ -719,7 +716,7 @@ ia64_expand_tls_address (enum tls_model tls_kind, rtx op0, rtx op1) tga_op1 = gen_reg_rtx (Pmode); emit_insn (gen_load_ltoff_dtpmod (tga_op1, op1)); tga_op1 = gen_rtx_MEM (Pmode, tga_op1); - RTX_UNCHANGING_P (tga_op1) = 1; + MEM_READONLY_P (tga_op1) = 1; tga_op2 = const0_rtx; @@ -750,7 +747,7 @@ ia64_expand_tls_address (enum tls_model tls_kind, rtx op0, rtx op1) tmp = gen_reg_rtx (Pmode); emit_insn (gen_load_ltoff_tprel (tmp, op1)); tmp = gen_rtx_MEM (Pmode, tmp); - RTX_UNCHANGING_P (tmp) = 1; + MEM_READONLY_P (tmp) = 1; tmp = force_reg (Pmode, tmp); if (!register_operand (op0, Pmode)) diff --git a/gcc/config/ia64/ia64.md b/gcc/config/ia64/ia64.md index 31af3bb..8b3cfdb 100644 --- a/gcc/config/ia64/ia64.md +++ b/gcc/config/ia64/ia64.md @@ -719,7 +719,7 @@ { operands[2] = no_new_pseudos ? operands[0] : gen_reg_rtx (DImode); operands[3] = gen_rtx_MEM (DImode, operands[2]); - RTX_UNCHANGING_P (operands[3]) = 1; + MEM_READONLY_P (operands[3]) = 1; }) (define_insn "*load_fptr_internal1" diff --git a/gcc/config/iq2000/iq2000.c b/gcc/config/iq2000/iq2000.c index a137744..ece7021 100644 --- a/gcc/config/iq2000/iq2000.c +++ b/gcc/config/iq2000/iq2000.c @@ -2084,9 +2084,6 @@ save_restore_insns (int store_p) gen_rtx_PLUS (Pmode, base_reg_rtx, GEN_INT (gp_offset - base_offset))); - if (! current_function_calls_eh_return) - RTX_UNCHANGING_P (mem_rtx) = 1; - reg_rtx = gen_rtx_REG (gpr_mode, regno); if (store_p) diff --git a/gcc/config/m32r/m32r.c b/gcc/config/m32r/m32r.c index 52dbb77..191d0a7 100644 --- a/gcc/config/m32r/m32r.c +++ b/gcc/config/m32r/m32r.c @@ -1995,7 +1995,7 @@ m32r_legitimize_pic_address (rtx orig, rtx reg) emit_insn (gen_addsi3 (address, address, pic_offset_table_rtx)); pic_ref = gen_rtx_MEM (Pmode, address); - RTX_UNCHANGING_P (pic_ref) = 1; + MEM_READONLY_P (pic_ref) = 1; insn = emit_move_insn (reg, pic_ref); current_function_uses_pic_offset_table = 1; #if 0 diff --git a/gcc/config/m68k/m68k.c b/gcc/config/m68k/m68k.c index e44f490..088714c 100644 --- a/gcc/config/m68k/m68k.c +++ b/gcc/config/m68k/m68k.c @@ -1383,7 +1383,7 @@ legitimize_pic_address (rtx orig, enum machine_mode mode ATTRIBUTE_UNUSED, gen_rtx_PLUS (Pmode, pic_offset_table_rtx, orig)); current_function_uses_pic_offset_table = 1; - RTX_UNCHANGING_P (pic_ref) = 1; + MEM_READONLY_P (pic_ref) = 1; emit_move_insn (reg, pic_ref); return reg; } diff --git a/gcc/config/mcore/mcore.c b/gcc/config/mcore/mcore.c index a29a25f..3d9d6d8 100644 --- a/gcc/config/mcore/mcore.c +++ b/gcc/config/mcore/mcore.c @@ -1882,7 +1882,7 @@ block_move_sequence (rtx dest, rtx dst_mem, rtx src, rtx src_mem, #endif gen_rtx_PLUS (Pmode, src, GEN_INT (offset_ld))); - RTX_UNCHANGING_P (srcp) = RTX_UNCHANGING_P (src_mem); + MEM_READONLY_P (srcp) = MEM_READONLY_P (src_mem); MEM_VOLATILE_P (srcp) = MEM_VOLATILE_P (src_mem); MEM_IN_STRUCT_P (srcp) = 1; emit_insn (gen_rtx_SET (VOIDmode, temp[next], srcp)); @@ -1902,7 +1902,7 @@ block_move_sequence (rtx dest, rtx dst_mem, rtx src, rtx src_mem, #endif gen_rtx_PLUS (Pmode, dest, GEN_INT (offset_st))); - RTX_UNCHANGING_P (dstp) = RTX_UNCHANGING_P (dst_mem); + MEM_READONLY_P (dstp) = MEM_READONLY_P (dst_mem); MEM_VOLATILE_P (dstp) = MEM_VOLATILE_P (dst_mem); MEM_IN_STRUCT_P (dstp) = 1; emit_insn (gen_rtx_SET (VOIDmode, dstp, temp[phase])); diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index 7865ca8..08e38ca 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -2342,7 +2342,6 @@ mips_restore_gp (void) : stack_pointer_rtx, current_function_outgoing_args_size); slot = gen_rtx_MEM (Pmode, address); - RTX_UNCHANGING_P (slot) = 1; emit_move_insn (pic_offset_table_rtx, slot); if (!TARGET_EXPLICIT_RELOCS) @@ -5801,8 +5800,6 @@ mips_save_restore_reg (enum machine_mode mode, int regno, rtx mem; mem = gen_rtx_MEM (mode, plus_constant (stack_pointer_rtx, offset)); - if (!current_function_calls_eh_return) - RTX_UNCHANGING_P (mem) = 1; fn (gen_rtx_REG (mode, regno), mem); } @@ -6980,7 +6977,6 @@ mips16_gp_pseudo_reg (void) rtx insn, scan; cfun->machine->mips16_gp_pseudo_rtx = gen_reg_rtx (Pmode); - RTX_UNCHANGING_P (cfun->machine->mips16_gp_pseudo_rtx) = 1; /* We want to initialize this to a value which gcc will believe is constant. */ diff --git a/gcc/config/mn10300/mn10300.md b/gcc/config/mn10300/mn10300.md index 4333ad2..d6bf540 100644 --- a/gcc/config/mn10300/mn10300.md +++ b/gcc/config/mn10300/mn10300.md @@ -2633,7 +2633,7 @@ { rtx insn = emit_insn (gen_symGOT2reg_i (operands[0], operands[1])); - RTX_UNCHANGING_P (SET_SRC (PATTERN (insn))) = 1; + MEM_READONLY_P (SET_SRC (PATTERN (insn))) = 1; REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_EQUAL, operands[1], REG_NOTES (insn)); diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c index 314c5f8..d1ed718 100644 --- a/gcc/config/pa/pa.c +++ b/gcc/config/pa/pa.c @@ -1021,7 +1021,7 @@ legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg) current_function_uses_pic_offset_table = 1; MEM_NOTRAP_P (pic_ref) = 1; - RTX_UNCHANGING_P (pic_ref) = 1; + MEM_READONLY_P (pic_ref) = 1; mark_reg_pointer (reg, BITS_PER_UNIT); insn = emit_move_insn (reg, pic_ref); diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 0312596..0c38a60 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -3458,7 +3458,7 @@ rs6000_legitimize_tls_address (rtx addr, enum tls_model model) tmp2 = gen_reg_rtx (Pmode); tmp3 = gen_reg_rtx (Pmode); mem = gen_rtx_MEM (Pmode, tmp1); - RTX_UNCHANGING_P (mem) = 1; + MEM_READONLY_P (mem) = 1; first = emit_insn (gen_load_toc_v4_PIC_1b (tempLR, lab, gsym)); @@ -4410,7 +4410,7 @@ rs6000_emit_move (rtx dest, rtx source, enum machine_mode mode) = gen_rtx_MEM (mode, create_TOC_reference (XEXP (operands[1], 0))); set_mem_alias_set (operands[1], get_TOC_alias_set ()); - RTX_UNCHANGING_P (operands[1]) = 1; + MEM_READONLY_P (operands[1]) = 1; } } break; diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index 627940c..49d4a24 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -2605,7 +2605,7 @@ legitimize_pic_address (rtx orig, rtx reg) new = gen_rtx_CONST (Pmode, new); new = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, new); new = gen_rtx_MEM (Pmode, new); - RTX_UNCHANGING_P (new) = 1; + MEM_READONLY_P (new) = 1; emit_move_insn (reg, new); new = reg; } @@ -2621,7 +2621,7 @@ legitimize_pic_address (rtx orig, rtx reg) emit_move_insn (temp, new); new = gen_rtx_MEM (Pmode, temp); - RTX_UNCHANGING_P (new) = 1; + MEM_READONLY_P (new) = 1; emit_move_insn (reg, new); new = reg; } @@ -2642,7 +2642,7 @@ legitimize_pic_address (rtx orig, rtx reg) new = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, temp); new = gen_rtx_MEM (Pmode, new); - RTX_UNCHANGING_P (new) = 1; + MEM_READONLY_P (new) = 1; emit_move_insn (reg, new); new = reg; } @@ -2933,7 +2933,7 @@ legitimize_tls_address (rtx addr, rtx reg) new = gen_rtx_CONST (Pmode, new); new = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, new); new = gen_rtx_MEM (Pmode, new); - RTX_UNCHANGING_P (new) = 1; + MEM_READONLY_P (new) = 1; temp = gen_reg_rtx (Pmode); emit_move_insn (temp, new); } @@ -2948,7 +2948,7 @@ legitimize_tls_address (rtx addr, rtx reg) emit_move_insn (temp, new); new = gen_rtx_MEM (Pmode, temp); - RTX_UNCHANGING_P (new) = 1; + MEM_READONLY_P (new) = 1; temp = gen_reg_rtx (Pmode); emit_move_insn (temp, new); } @@ -2968,7 +2968,7 @@ legitimize_tls_address (rtx addr, rtx reg) new = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, temp); new = gen_rtx_MEM (Pmode, new); - RTX_UNCHANGING_P (new) = 1; + MEM_READONLY_P (new) = 1; new = gen_rtx_UNSPEC (Pmode, gen_rtvec (2, new, addr), UNSPEC_TLS_LOAD); temp = gen_reg_rtx (Pmode); @@ -2987,7 +2987,7 @@ legitimize_tls_address (rtx addr, rtx reg) new = temp; new = gen_rtx_MEM (Pmode, new); - RTX_UNCHANGING_P (new) = 1; + MEM_READONLY_P (new) = 1; new = gen_rtx_UNSPEC (Pmode, gen_rtvec (2, new, addr), UNSPEC_TLS_LOAD); temp = gen_reg_rtx (Pmode); diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md index 53d1220..0cbcc0a 100644 --- a/gcc/config/s390/s390.md +++ b/gcc/config/s390/s390.md @@ -6841,7 +6841,7 @@ emit_move_insn (base, gen_rtx_LABEL_REF (Pmode, operands[3])); index = gen_rtx_MEM (Pmode, gen_rtx_PLUS (Pmode, base, index)); - RTX_UNCHANGING_P (index) = 1; + MEM_READONLY_P (index) = 1; MEM_NOTRAP_P (index) = 1; emit_move_insn (target, index); diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index 4a59f5c..6b72e49 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -1042,7 +1042,7 @@ prepare_move_operands (rtx operands[], enum machine_mode mode) emit_insn (gen_load_gbr (tmp2)); tmp = gen_reg_rtx (Pmode); emit_insn (gen_symTPOFF2reg (tmp, op1)); - RTX_UNCHANGING_P (tmp) = 1; + MEM_READONLY_P (tmp) = 1; if (register_operand (op0, Pmode)) op1 = op0; @@ -4383,7 +4383,6 @@ sh_reorg (void) /* Remove the clobber of r0. */ *clobberp = gen_rtx_CLOBBER (GET_MODE (clobber), gen_rtx_SCRATCH (Pmode)); - RTX_UNCHANGING_P (newsrc) = 1; } /* This is a mova needing a label. Create it. */ else if (GET_CODE (src) == UNSPEC @@ -4401,7 +4400,7 @@ sh_reorg (void) lab = add_constant (src, mode, 0); newsrc = gen_rtx_MEM (mode, gen_rtx_LABEL_REF (VOIDmode, lab)); - RTX_UNCHANGING_P (newsrc) = 1; + MEM_READONLY_P (newsrc) = 1; } *patp = gen_rtx_SET (VOIDmode, dst, newsrc); INSN_CODE (scan) = -1; diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md index cb7de40..45b48eb 100644 --- a/gcc/config/sh/sh.md +++ b/gcc/config/sh/sh.md @@ -6766,7 +6766,7 @@ PUT_MODE (gotsym, Pmode); insn = emit_insn (gen_symGOT_load (operands[0], gotsym)); - RTX_UNCHANGING_P (SET_SRC (PATTERN (insn))) = 1; + MEM_READONLY_P (SET_SRC (PATTERN (insn))) = 1; DONE; }") diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c index 7db26cf..f1f2b21 100644 --- a/gcc/config/sparc/sparc.c +++ b/gcc/config/sparc/sparc.c @@ -3809,7 +3809,7 @@ legitimize_pic_address (rtx orig, enum machine_mode mode ATTRIBUTE_UNUSED, gen_rtx_PLUS (Pmode, pic_offset_table_rtx, address)); current_function_uses_pic_offset_table = 1; - RTX_UNCHANGING_P (pic_ref) = 1; + MEM_READONLY_P (pic_ref) = 1; insn = emit_move_insn (reg, pic_ref); /* Put a REG_EQUAL note on this insn, so that it can be optimized by loop. */ diff --git a/gcc/config/v850/v850.md b/gcc/config/v850/v850.md index 503f1fe..900f1e3 100644 --- a/gcc/config/v850/v850.md +++ b/gcc/config/v850/v850.md @@ -1321,7 +1321,7 @@ emit_insn (gen_addsi3 (reg, reg, tableaddress)); /* Load the table entry. */ mem = gen_rtx_MEM (CASE_VECTOR_MODE, reg); - RTX_UNCHANGING_P (mem) = 1; + MEM_READONLY_P (mem) = 1; if (! TARGET_BIG_SWITCH) { rtx reg2 = gen_reg_rtx (HImode); |