aboutsummaryrefslogtreecommitdiff
path: root/gcc/function.c
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2011-07-19 17:43:27 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2011-07-19 17:43:27 +0000
commit527210c448c692264cebb61acf3a2c6aef3073ad (patch)
treedc0b299847e998d99b662b29fa6960f8e4d4b826 /gcc/function.c
parentf5541398efc0174bbdc40933be77747ad2000426 (diff)
downloadgcc-527210c448c692264cebb61acf3a2c6aef3073ad.zip
gcc-527210c448c692264cebb61acf3a2c6aef3073ad.tar.gz
gcc-527210c448c692264cebb61acf3a2c6aef3073ad.tar.bz2
rtl.texi (MEM_OFFSET_KNOWN_P): Document.
gcc/ * doc/rtl.texi (MEM_OFFSET_KNOWN_P): Document. (MEM_OFFSET): Change from returning an rtx to returning a HOST_WIDE_INT. * rtl.h (MEM_OFFSET_KNOWN_P): New macro. (MEM_OFFSET): Return a HOST_WIDE_INT rather than an rtx. * emit-rtl.h (set_mem_offset): Take a HOST_WIDE_INT rather than an rtx. (clear_mem_offset): Declare. * alias.c (ao_ref_from_mem): Adjust uses of MEM_OFFSET, using MEM_OFFSET_KNOWN_P to test whether the offset is known, and MEM_OFFSET to get a HOST_WIDE_INT offset. (nonoverlapping_memrefs_p): Likewise. Adjust calls to... (adjust_offset_for_component_ref): Take a bool "known_p" parameter and a HOST_WIDE_INT "offset" parameter. * builtins.c (get_memory_rtx): As for ao_ref_from_mem. Adjust calls to set_mem_offset, passing a HOST_WIDE_INT rather than an rtx. Use clear_mem_offset to clear the offset. * cfgcleanup.c (merge_memattrs): Likewise. * dwarf2out.c (tls_mem_loc_descriptor): Likewise. * function.c (assign_parm_find_stack_rtl): Likewise. (assign_parm_setup_stack): Likewise. * print-rtl.c (print_rtx): Likewise. * reload.c (find_reloads_subreg_address): Likewise. * simplify-rtx.c (delegitimize_mem_from_attrs): Likewise. * var-tracking.c (INT_MEM_OFFSET): Likewise. * emit-rtl.c (set_reg_attrs_from_value): Likewise. (get_mem_align_offset): Likewise. (set_mem_offset): Take a HOST_WIDE_INT rather than an rtx. (clear_mem_offset): New function. * config/mips/mips.c (r10k_safe_mem_expr_p): Take a HOST_WIDE_INT offset rather than an rtx. Assume both the expressio and offset are available. (r10k_needs_protection_p_1): Update accordingly, checking the expression and offset availability here instead. From-SVN: r176477
Diffstat (limited to 'gcc/function.c')
-rw-r--r--gcc/function.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/gcc/function.c b/gcc/function.c
index 9e65bfd..361a8dc 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -2577,14 +2577,12 @@ assign_parm_find_stack_rtl (tree parm, struct assign_parm_data_one *data)
&& data->promoted_mode != DECL_MODE (parm))
{
set_mem_size (stack_parm, GET_MODE_SIZE (data->promoted_mode));
- if (MEM_EXPR (stack_parm) && MEM_OFFSET (stack_parm))
+ if (MEM_EXPR (stack_parm) && MEM_OFFSET_KNOWN_P (stack_parm))
{
int offset = subreg_lowpart_offset (DECL_MODE (parm),
data->promoted_mode);
if (offset)
- set_mem_offset (stack_parm,
- plus_constant (MEM_OFFSET (stack_parm),
- -offset));
+ set_mem_offset (stack_parm, MEM_OFFSET (stack_parm) - offset);
}
}
}
@@ -3198,10 +3196,9 @@ assign_parm_setup_stack (struct assign_parm_data_all *all, tree parm,
/* ??? This may need a big-endian conversion on sparc64. */
data->stack_parm
= adjust_address (data->stack_parm, data->nominal_mode, 0);
- if (offset && MEM_OFFSET (data->stack_parm))
+ if (offset && MEM_OFFSET_KNOWN_P (data->stack_parm))
set_mem_offset (data->stack_parm,
- plus_constant (MEM_OFFSET (data->stack_parm),
- offset));
+ MEM_OFFSET (data->stack_parm) + offset);
}
}